remotior_sensus.tools.band_neighbor_pixels module

Band neighbor pixels.

This tool allows for the calculation of a function over neighbor pixels defined by size (i.e. number of pixels) or a structure.

Typical usage example:

>>> # import Remotior Sensus and start the session
>>> import remotior_sensus
>>> rs = remotior_sensus.Session()
>>> # start the process
>>> neighbor = rs.band_neighbor_pixels(
... input_bands=['file1.tif', 'file2.tif'],
... size=1,output_path='directory_path',stat_name='Mean',
... circular_structure=True,prefix='neighbor_')
remotior_sensus.tools.band_neighbor_pixels.band_neighbor_pixels(input_bands: list | int | BandSet, size: int, output_path: None | str = None, overwrite: bool | None = False, stat_name: str | None = None, structure: any | None = None, circular_structure: bool | None = True, stat_percentile: None | int | str = None, output_data_type: None | str = None, virtual_output: bool | None = None, prefix: str | None = '', extent_list: list | None = None, n_processes: None | int = None, available_ram: None | int = None, bandset_catalog: BandSetCatalog | None = None) OutputManager

Performs band neighbor pixels.

This tool calculates a function over neighbor pixels defined by size (i.e. number of pixels) or structure. A new raster is created for each input band, where each pixel is the result of the calculation of the function over the neighbor pixels (e.g. the mean of the pixel values of a 3x3 window around the pixel). Available functions are:

  • Count

  • Max

  • Mean

  • Median

  • Min

  • Percentile

  • StandardDeviation

  • Sum

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

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

  • overwrite – if True, output overwrites existing files.

  • size – size of dilation in pixels.

  • structure – optional path to csv file of structures, if None then the structure is created from size.

  • circular_structure – if True use circular structure.

  • stat_percentile – integer value for percentile parameter.

  • stat_name – statistic name as in configurations.statistics_list.

  • output_data_type – optional raster output data type, if None the data type is the same as input raster.

  • 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.

  • 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 neighbor of size 10 pixels with the function Sum
>>> neighbor = band_neighbor_pixels(input_bands=['file1.tif', 'file2.tif'],size=10,output_path='directory_path',stat_name='Sum',circular_structure=True)