remotior_sensus.core.output_manager module

Output manager.

Core class that manages several types of output, mainly intended for tools that have several outputs.

Typical usage example:

>>> # process output is checked
>>> OutputManager()
class remotior_sensus.core.output_manager.OutputManager(check: bool = True, path: str | None = None, paths: list | None = None, extra=None)

Bases: object

Manages output.

This class manages several types of output, mainly intended for tools that have several outputs. Check argument is False if output failed. Single output raster or multiple file paths can be defined as arguments. Additional output files or tables are managed with an extra argument. The type of the extra argument can be flexible depending on the process output.

check

True if output is as expected, False if process failed.

path

path of the first output.

paths

list of output paths in case of multiple outputs.

extra

additional output elements depending on the process.

Examples

Output failed
>>> OutputManager(check=False)
Output is checked and file path is provided
>>> OutputManager(path='file.tif')
__init__(check: bool = True, path: str | None = None, paths: list | None = None, extra=None)

Initializes an Output.

Initializes an Output.

Parameters:
  • check – True if output is as expected, False if process failed.

  • path – path of the first output.

  • paths – list of output paths in case of multiple outputs.

  • extra – additional output elements depending on the process.

Examples

Create an object with a single file path
>>> OutputManager(path='file.tif')
Create an object with several output file paths in a list and an extra argument for a dictionary
>>> OutputManager(
... paths=['file1.tif', 'file2.tif'],
... extra={'additional_output': 'file.csv'}
... )

)

add_to_bandset(bandset_catalog: BandSetCatalog, bandset_number=None, band_number=None, raster_band=None, band_name=None, date=None, unit=None, root_directory=None, multiplicative_factor=None, additive_factor=None, wavelength=None)

Adds output to BandSet.

Adds the OutputManager.path as a band to a BandSet in a BandSetCatalog.

Parameters:
  • bandset_catalog – BandSetCatalog object.

  • band_name – raster name used for identifying the bands.

  • wavelength – center wavelengths of band.

  • unit – wavelength unit as string

  • multiplicative_factor – multiplicative factor for bands during calculations.

  • additive_factor – additive factors for band during calculations.

  • date – date string (format YYYY-MM-DD).

  • bandset_number – number of the BandSet; if None, the band is added to the current BandSet.

  • root_directory – root directory for relative path.

  • raster_band – raster band number.

  • band_number – number of band in BandSet.

Examples

Add the output to BandSet 1 as band 1.
>>> catalog = BandSetCatalog()
>>> OutputManager.add_to_bandset(
... bandset_catalog=catalog, bandset_number=1, band_number=1
... )