remotior_sensus.tools.band_mask module

Band mask.

This tool allows for masking bands using a vector or raster mask.

Typical usage example:

>>> # import Remotior Sensus and start the session
>>> import remotior_sensus
>>> rs = remotior_sensus.Session()
>>> # start the process
>>> rs.band_mask(input_bands=['path_1', 'path_2'],
... input_mask='mask_path', mask_values=[1, 2]
... output_path='output_path')
remotior_sensus.tools.band_mask.band_mask(input_bands: list | int | BandSet, input_mask: str | None = None, mask_values: list | None = None, output_path: None | str = None, overwrite: bool | None = False, buffer: None | int = None, nodata_value: None | int = None, virtual_output: bool | None = None, compress=None, compress_format=None, prefix: str | None = '', extent_list: list | None = None, n_processes: None | int = None, available_ram: None | int = None, bandset_catalog: BandSetCatalog | None = None)

Performs band mask.

This tool allows for masking bands using a vector or raster mask.

Parameters:
  • input_bands – reference_raster of type BandSet or list of paths or integer number of BandSet.

  • input_mask – string path of raster or vector used for masking.

  • mask_values – list of values in the mask to be used for masking.

  • output_path – string of output path directory or list of paths.

  • overwrite – if True, output overwrites existing files.

  • buffer – optional buffer size, in number of pixels, to expand the mask.

  • nodata_value – value to be used as nodata in the output.

  • virtual_output – if True (and output_path is directory), save output as virtual raster of multiprocess parts.

  • prefix – optional string for output name prefix.

  • extent_list – list of boundary coordinates left top right bottom.

  • compress – if True, compress output.

  • compress_format – format of compressions such as LZW or DEFLATE.

  • n_processes – number of parallel processes.

  • available_ram – number of megabytes of RAM available to processes.

  • bandset_catalog – optional type BandSetCatalog for BandSet number.

Returns:

Object OutputManager() with
  • paths = output list

Examples

Perform the band resample
>>> band_mask(input_bands=['path_1', 'path_2'],
... input_mask='mask_path', mask_values=[1, 2],
... output_path='output_path')