geoips.plugins.modules.algorithms package#

Subpackages#

Submodules#

geoips.plugins.modules.algorithms.single_channel module#

Data manipulation steps for standard “single_channel” algorithm.

Generalized algorithm to apply data manipulation steps in a standard order to apply corrections to a single channel output product.

geoips.plugins.modules.algorithms.single_channel.call(arrays, output_data_range=None, input_units=None, output_units=None, min_outbounds='crop', max_outbounds='crop', norm=False, inverse=False, sun_zen_correction=False, mask_night=False, max_day_zen=None, mask_day=False, min_night_zen=None, gamma_list=None, scale_factor=None)[source]#

Apply data range and requested corrections to a single channel product.

Data manipulation steps for applying a data range and requested corrections to a single channel product

Parameters:
  • arrays (list of numpy.ndarray) –

    • list of numpy.ndarray or numpy.MaskedArray of channel data

    • MUST be length one for single_channel algorithm.

  • output_data_range (list of float, default=None) –

    • list of min and max value for output data product.

    • This is applied LAST after all other corrections/adjustments

    • If None, use data min and max.

  • input_units (str, default=None) –

    • Units of input data, for applying necessary conversions

    • If None, no conversion

  • output_units (str, default=None) –

    • Units of output data, for applying necessary conversions

    • If None, no conversion

  • min_outbounds (str, default='crop') –

    • Method to use when applying bounds. Valid values are:

      • retain: keep all pixels as is

      • mask: mask all pixels that are out of range

      • crop: set all out of range values to either min_val or max_val as appropriate

  • max_outbounds (str, default='crop') –

    • Method to use when applying bounds. Valid values are:

      • retain: keep all pixels as is

      • mask: mask all pixels that are out of range

      • crop: set all out of range values to either min_val or max_val as appropriate

  • norm (bool, default=False) –

    • Boolean flag indicating whether to normalize (True) or not (False)

      • If True, returned data will be in the range from 0 to 1

      • If False, returned data will be in the range from min_val to max_val

  • inverse (bool, default=False) –

    • Boolean flag indicating whether to inverse (True) or not (False)

      • If True, returned data will be inverted

      • If False, returned data will not be inverted

  • sun_zenith_correction (bool, default=False) –

    • Boolean flag indicating whether to apply solar zenith correction (True) or not (False)

      • If True, returned data will have solar zenith correction applied (see data_manipulations.corrections.apply_solar_zenith_correction)

      • If False, returned data will not be modified based on solar zenith angle

Notes

Order of operations, based on the passed arguments, is:

  1. Mask night

  2. Mask day

  3. Apply solar zenith correction

  4. Apply gamma values

  5. Apply scale factor

  6. Convert units

  7. Apply data range.

NOTE: If “norm=True” is specified, the “output_data_range” will NOT match the actual range of the returned data, since the normalized data will be returned between 0 and 1.

If you require a different order of operations than that specified within “single_channel” algorithm, please create a new algorithm for your desired order of operations.

Returns:

numpy.ndarray or numpy.MaskedArray of appropriately scaled channel data, in units “output_units”.

Return type:

numpy.ndarray

Module contents#

geoips algorithms init file.