sicor.sensors package

Subpackages

Submodules

sicor.sensors.RSImage module

class sicor.sensors.RSImage.RSImage(unit='reflectance', target_resolution=None, bad_data_value=nan, dtype_float=<class 'numpy.float16'>, mask_clouds=None, **kwargs)[source]

Bases: object

Remote Sensing Image base class.

Parameters:
  • unit – string “reflectance”, in future other units might be supported

  • target_resolution – None: keep data as is (e.g. separate bands), or give spatial sampling for interpolation to larger cube

  • bad_data_value – vale to exclude data from processing

  • dtype_float – dtype for intermediate computations

  • *kwargs

    See below

Keyword Arguments:
  • data: {B10:ndarray(dtype=float16),[…],B09:ndarray(dtype=float16)}

  • tile_name: “32UMA”

  • nodata (and or yesdata with same interface){60.0:ndarray(dtype=bool),[…],20.0:ndarray(dtype=bool)}

  • band_spatial_sampling: {B10:60.0,[…],B02:10.0,[…],B11:20.0}

  • mask_clouds: should be instance of S2MSI.Mask or similar object, some attributes need to be

    present: [‘clf_to_col’, ‘export_confidence_to_jpeg2000’, ‘export_mask_blend’, ‘export_mask_rgb’, ‘export_to_jpeg200’, ‘geo_coding’, ‘mask_array’, ‘mask_confidence_array’, ‘mask_legend’, ‘mask_legend_inv’, ‘mask_rgb_array’, ‘metadata’, ‘mk_mask_at_spatial_scales’]

  • metadata:

{"U":1.0,# Eun - Earth distance
 "SENSING_TIME":2015-08-12 10:40:21.459000+00:00,
 "viewing_zenith":{B10:ndarray(dtype=float16),[...],B09:ndarray(dtype=float16)},
 "viewing_azimut":{B10:ndarray(dtype=float16),[...],B09:ndarray(dtype=float16)},
 "sun_mean_azimuth":161.57,
 "sun_mean_zenith":36.21,
 "solar_irradiance:{B10:367.15,[...],B09:813.04},
 "aux_data":{},
 "spatial_samplings":{
        60.0:{
        XDIM:60,
        NCOLS:1830,
        NROWS:1830,
        YDIM:-60,
        ULX:399960,
        ULY:5600040
        },
        10.0:{
        XDIM:10,
        NCOLS:10980,
        NROWS:10980,
        YDIM:-10,
        ULX:399960,
        ULY:5600040
        },
        20.0:{
        XDIM:20,
        NCOLS:5490,
        NROWS:5490,
        YDIM:-20,
        ULX:399960,
        ULY:5600040
        }}
_validate()[source]
ecmwf_xi()[source]
image_subsample(channels, target_resolution, order=3)[source]
Parameters:
  • channels – list of strings with channel names

  • target_resolution – float

  • order – interpolation order, integer

Returns:

data as desired

image_to_rgb(rgb_bands=('B11', 'B08', 'B03'), rgb_gamma=(1.0, 1.0, 1.0), hist_chop_off_fraction=0.01, output_size=None, max_hist_pixel=1000000, resample_order=3)[source]
sicor.sensors.RSImage.arguments(ignore=['logger'])[source]

Returns tuple containing dictionary of calling function’s named arguments and a list of calling function’s unnamed positional arguments.

class sicor.sensors.RSImage.const_snr_model(snr: Number)[source]

Bases: object

SNR model with constant snr.

SNR of instrument.

noise(reflectance, **kwargs)[source]

Error, simply computed from SNR.

sicor.sensors.SRF module

class sicor.sensors.SRF.SensorSRF(sensor='S2A')[source]

Bases: __SensorSRF

Instrument spectral response functions for all supported sensors. :param sensor: String with support instrument identifier, possible is: ‘S2A’,’Landsat-8’ :returns: Sicor __SensorSRF object

landsat(sensor)[source]

Read Landsat srf’s from zipfile which includes srf’s for multiple instruments :param sensor: “Landsat-X”, X=8,…, :return: srfs, wvl for __SensorSRF.__init__

sentinel2(sensor='S2A')[source]

Load Sentinel-2A spectral response function.

Parameters:

sensor – name of Sentinel sensor (2A or 2B)

Returns:

srfs, wvl for __SensorSRF.__init__

class sicor.sensors.SRF.__SensorSRF(srfs, srfs_wvl)[source]

Bases: object

Baseclass for instrument sicor srfs. :param srfs: dictionary with [band_name]:[numpy array with spectral response function table for srfs_wvl] :param srfs_wvl: spectral axis for all srf’s in srfs

instrument(bands)[source]

Module contents

class sicor.sensors.RSImage(unit='reflectance', target_resolution=None, bad_data_value=nan, dtype_float=<class 'numpy.float16'>, mask_clouds=None, **kwargs)[source]

Bases: object

Remote Sensing Image base class.

Parameters:
  • unit – string “reflectance”, in future other units might be supported

  • target_resolution – None: keep data as is (e.g. separate bands), or give spatial sampling for interpolation to larger cube

  • bad_data_value – vale to exclude data from processing

  • dtype_float – dtype for intermediate computations

  • *kwargs

    See below

Keyword Arguments:
  • data: {B10:ndarray(dtype=float16),[…],B09:ndarray(dtype=float16)}

  • tile_name: “32UMA”

  • nodata (and or yesdata with same interface){60.0:ndarray(dtype=bool),[…],20.0:ndarray(dtype=bool)}

  • band_spatial_sampling: {B10:60.0,[…],B02:10.0,[…],B11:20.0}

  • mask_clouds: should be instance of S2MSI.Mask or similar object, some attributes need to be

    present: [‘clf_to_col’, ‘export_confidence_to_jpeg2000’, ‘export_mask_blend’, ‘export_mask_rgb’, ‘export_to_jpeg200’, ‘geo_coding’, ‘mask_array’, ‘mask_confidence_array’, ‘mask_legend’, ‘mask_legend_inv’, ‘mask_rgb_array’, ‘metadata’, ‘mk_mask_at_spatial_scales’]

  • metadata:

{"U":1.0,# Eun - Earth distance
 "SENSING_TIME":2015-08-12 10:40:21.459000+00:00,
 "viewing_zenith":{B10:ndarray(dtype=float16),[...],B09:ndarray(dtype=float16)},
 "viewing_azimut":{B10:ndarray(dtype=float16),[...],B09:ndarray(dtype=float16)},
 "sun_mean_azimuth":161.57,
 "sun_mean_zenith":36.21,
 "solar_irradiance:{B10:367.15,[...],B09:813.04},
 "aux_data":{},
 "spatial_samplings":{
        60.0:{
        XDIM:60,
        NCOLS:1830,
        NROWS:1830,
        YDIM:-60,
        ULX:399960,
        ULY:5600040
        },
        10.0:{
        XDIM:10,
        NCOLS:10980,
        NROWS:10980,
        YDIM:-10,
        ULX:399960,
        ULY:5600040
        },
        20.0:{
        XDIM:20,
        NCOLS:5490,
        NROWS:5490,
        YDIM:-20,
        ULX:399960,
        ULY:5600040
        }}
_validate()[source]
ecmwf_xi()[source]
image_subsample(channels, target_resolution, order=3)[source]
Parameters:
  • channels – list of strings with channel names

  • target_resolution – float

  • order – interpolation order, integer

Returns:

data as desired

image_to_rgb(rgb_bands=('B11', 'B08', 'B03'), rgb_gamma=(1.0, 1.0, 1.0), hist_chop_off_fraction=0.01, output_size=None, max_hist_pixel=1000000, resample_order=3)[source]
class sicor.sensors.SensorSRF(sensor='S2A')[source]

Bases: __SensorSRF

Instrument spectral response functions for all supported sensors. :param sensor: String with support instrument identifier, possible is: ‘S2A’,’Landsat-8’ :returns: Sicor __SensorSRF object

landsat(sensor)[source]

Read Landsat srf’s from zipfile which includes srf’s for multiple instruments :param sensor: “Landsat-X”, X=8,…, :return: srfs, wvl for __SensorSRF.__init__

sentinel2(sensor='S2A')[source]

Load Sentinel-2A spectral response function.

Parameters:

sensor – name of Sentinel sensor (2A or 2B)

Returns:

srfs, wvl for __SensorSRF.__init__