enpt.model.metadata package

Submodules

enpt.model.metadata.metadata_mapgeo module

EnPT metadata objects for EnMAP data in map geometry.

class enpt.model.metadata.metadata_mapgeo.EnMAP_Metadata_L2A_MapGeo(config: EnPTConfig, meta_l1b: EnMAP_Metadata_L1B_SensorGeo, wvls_l2a: Union[List, ndarray], dims_mapgeo: Tuple[int, int, int], grid_res_l2a: Tuple[float, float], logger=None)[source]

Bases: object

EnMAP Metadata class for the metadata of the complete EnMAP L2A product in map geometry incl. VNIR and SWIR.

Parameters
  • config – EnPT configuration object

  • meta_l1b – metadata object of the L1B dataset in sensor geometry

  • wvls_l2a – list of center wavelengths included in the L2A product

  • dims_mapgeo – dimensions of the EnMAP raster data in map geometry, e.g., (1024, 1000, 218)

  • grid_res_l2a – Coordinate grid resolution of the L2A product (x, y)

  • logger – instance of logging.logger or subclassed

add_band_statistics(datastack_vnir_swir: Union[ndarray, GeoArray])[source]
add_product_fileinformation(filepaths: List[str], sizes: Optional[List[int]] = None, versions: Optional[List[str]] = None)[source]
get_common_UL_UR_LL_LR()[source]
to_XML() str[source]

Generate an XML metadata string from the L2A metadata.

enpt.model.metadata.metadata_mapgeo.xmlSubtree2dict(xml_root, path_subtree) OrderedDict[source]

enpt.model.metadata.metadata_sensorgeo module

EnPT metadata objects for EnMAP data in sensor geometry.

class enpt.model.metadata.metadata_sensorgeo.EnMAP_Metadata_L1B_Detector_SensorGeo(detector_name: str, config: EnPTConfig, logger: Optional[Logger] = None)[source]

Bases: object

Class for all EnMAP metadata associated with a single EnMAP detector in sensor geometry.

NOTE:
  • All metadata that have VNIR and SWIR detector in sensor geometry in common should be included here.

Get a metadata object containing the metadata of a single EnMAP detector in sensor geometry.

Parameters
  • detector_name – Name of the detector (VNIR or SWIR)

  • config – EnPT configuration object

  • logger – instance of logging.logger or subclassed

_get_snr_model(dir_snr_models: str) GeoArray[source]

Get the SNR model coefficients for the current detector.

NOTE: Missing bands are linearly interpolated.

Parameters

dir_snr_models – directory containing the SNR models

calc_smile()[source]

Compute smile for each EnMAP column.

The sum in (1) is expressed as inner product of two arrays with inner dimension as the polynomial smile coefficients shape = (ncols, nsmile_coef) of polynomial x

Returns

calc_snr_from_radiance(rad_data: Union[GeoArray, ndarray], dir_snr_models: str)[source]

Compute EnMAP SNR from radiance data for the given detector.

SNR equation: SNR = p0 + p1 * LTOA + p2 * LTOA ^ 2 [W/(m^2 sr nm)].

NOTE: The SNR model files (SNR_D1.bsq/SNR_D2.bsq) contain polynomial coefficients needed to compute SNR.

SNR_D1.bsq: SNR model for EnMAP VNIR detector (contains high gain and low gain model coefficients)

  • 1000 columns (for 1000 EnMAP columns)

  • 88 bands for 88 EnMAP VNIR bands

  • 7 lines: - 3 lines: high gain coefficients
    • 3 lines: low gain coefficients

    • 1 line: threshold needed to decide about high gain or low gain

SNR_D2.bsq: SNR model for EnMAP SWIR detector

  • 1000 columns (for 1000 EnMAP columns)

  • x bands for x EnMAP SWIR bands

  • 3 lines for 3 coefficients

Parameters
  • rad_data – image radiance data of EnMAP_Detector_SensorGeo

  • dir_snr_models – root directory where SNR model data is stored (must contain SNR_D1.bsq/SNR_D2.bsq)

calc_solar_irradiance_CWL_FWHM_per_band() array[source]
compute_geolayer_for_cube()[source]
static interpolate_corners(ul: float, ur: float, ll: float, lr: float, nx: int, ny: int)[source]

Compute interpolated field from corner values of a scalar field given at: ul, ur, ll, lr.

Parameters
  • ul – tbd

  • ur – tbd

  • ll – tbd

  • lr – tbd

  • nx – final shape (x-axis direction)

  • ny – final shape (y-axis direction)

read_metadata(path_xml)[source]

Read the metadata of a specific EnMAP detector in sensor geometry.

Parameters

path_xml – file path of the metadata file

Returns

None

class enpt.model.metadata.metadata_sensorgeo.EnMAP_Metadata_L1B_SensorGeo(path_metaxml, config: EnPTConfig, logger=None)[source]

Bases: object

EnMAP Metadata class for the metadata of the complete EnMAP L1B product in sensor geometry incl. VNIR and SWIR.

Attributes:
  • logger(logging.Logger): None or logging instance

  • observation_datetime(datetime.datetime): datetime of observation time

  • geom_view_zenith: viewing zenith angle

  • geom_view_azimuth: viewing azimuth angle

  • geom_sun_zenith: sun zenith angle

  • geom_sun_azimuth: sun azimuth angle

  • mu_sun: needed by SICOR for TOARad > TOARef conversion

  • vnir(EnMAP_Metadata_VNIR_SensorGeo)

  • swir(EnMAP_Metadata_SWIR_SensorGeo)

  • detector_attrNames: attribute names of the detector objects

Get a metadata object instance for the given EnMAP L1B product in sensor geometry.

Parameters
  • path_metaxml – file path of the EnMAP L1B metadata XML file

  • logger – instance of logging.logger or subclassed

Para, config

EnPT configuration object

get_earth_sun_distance(acqDate: datetime)[source]

Get earth sun distance (requires file of pre calculated earth sun distance per day).

Parameters

acqDate

read_common_meta(path_xml)[source]

Read the common metadata, principally stored in General Info.

  • the acquisition time

  • the geometrical observation and illumination

Parameters

path_xml – path to the main xml file

Returns

None

read_metadata()[source]

Read the metadata of the entire EnMAP L1B product in sensor geometry.

property scene_basename
to_XML() str[source]

Generate an XML metadata string from the L1B metadata.

Module contents

EnPT metadata modules. All objects and functions regarding EnMAP metadata are implemented here.