eoio.readers.sentinel2.metadata.extractor module#
eoio.readers.sentinel2.metadata.extractor- extractor class for Sentinel-2 MSI metadata.
- class eoio.readers.sentinel2.metadata.extractor.S2MSIMetadataExtractor(reader)[source]#
Bases:
BaseMetadataExtractorHigh-level metadata extractor for Sentinel-2 MSI products.
This class orchestrates metadata extraction from both Sentinel-2 product- level metadata (
MTD_MSIL1C.xml/MTD_MSIL2A.xml) and tile-level metadata (MTD_TL.xml), and exposes the results as structured Python dictionaries suitable for downstream use (e.g. MetEOR tools).It delegates low-level XML parsing to
S2ProdXMLReaderandS2TLXMLReader.- get_basic_metadata() dict[source]#
Return high-level, product-wide metadata.
This metadata is intended for discovery, cataloguing, and general product description, and is shared across all variables in the dataset.
- Returns:
Dictionary containing basic Sentinel-2 product metadata.
- get_product_metadata() dict[source]#
Return detailed product- and tile-level metadata.
This metadata captures acquisition context, quality indicators, and tile identifiers that are not variable-specific.
- Returns:
Dictionary containing Sentinel-2 product metadata.
- get_variable_basic_metadata(var: str) dict[source]#
Return basic descriptive metadata for a dataset variable.
This method is intended for lightweight metadata such as units, names, or CF-style descriptors. It is currently a placeholder.
- Parameters:
var – Variable name for which metadata should be extracted.
- Returns:
Dictionary containing basic variable metadata.
- get_variable_product_metadata(var: str) dict[source]#
Return detailed metadata for a specific Sentinel-2 band variable.
This includes spatial characteristics, radiometric calibration parameters, and tile geometry information relevant to the band.
- Parameters:
var – Variable name corresponding to a Sentinel-2 band (e.g.
"B02").- Returns:
Dictionary containing variable-specific metadata.
- Raises:
KeyError – If
varis not a recognised Sentinel-2 band.