eoio.readers.sentinel2.metadata.s2_tl_mtd module#
eoio.readers.sentinel2.metadata.s2_tl_mtd - reader for Sentinel-2 tile metadata.
- class eoio.readers.sentinel2.metadata.s2_tl_mtd.S2TLXMLReader(path: Path)[source]#
Bases:
XMLReaderSentinel-2 tile metadata reader for
MTD_TL.xml.- build_xy_coords(resolution: int) tuple[ndarray, ndarray][source]#
Build 1-D x and y coordinate vectors for the tile grid (pixel centres).
- find_band_mean_viewing_grids(*, band_id: int) tuple[ndarray, ndarray][source]#
Return (mean_viewing_zenith, mean_viewing_azimuth) for a band averaged over detectors.
- find_degraded_msi_data_percentage() float[source]#
Return the DEGRADED_MSI_DATA_PERCENTAGE value (0–100).
- find_geoposition(resolution: int) dict[str, float][source]#
Return geoposition parameters for the given resolution (ULX/ULY/XDIM/YDIM).
- find_mask_filenames() dict[tuple[str, int | None], str][source]#
Return mask filenames as a mapping keyed by (mask_type, band_id).
Keys are: - (type, bandId) for masks that include bandId - (type, None) for masks without bandId (e.g. MSK_CLASSI)
Values are the corresponding MASK_FILENAME strings.
- find_mean_sun_angles() tuple[float, float][source]#
Return (mean_sun_zenith_deg, mean_sun_azimuth_deg).
- find_pvi_filename() str[source]#
Return the preview image filename (PVI_FILENAME) relative to the SAFE root.
- find_snow_pixel_percentage() float | None[source]#
Return the SNOW_PIXEL_PERCENTAGE value (0–100).
NB: Not defined in PSD < v15.0
- find_sun_angle_grid(direction) ndarray[source]#
Return the sun azimuth grid (degrees) as a 2-D array.
- find_sun_angle_steps() tuple[float, float][source]#
Return (col_step_m, row_step_m) for the sun angles grids.
- find_tile_shape(resolution: int) tuple[int, int][source]#
Return (nrows, ncols) for the given resolution (10/20/60).
- find_viewing_angle_grid(*, band_id: int, direction: str) tuple[ndarray, list[int]][source]#
Return the viewing azimuth grid (degrees) for a given bandId and detectorId.
- list_viewing_detectors(*, band_id: int) list[int][source]#
List detectorIds available for a given bandId.
- list_viewing_grids() list[tuple[int, int]][source]#
List available (bandId, detectorId) pairs for viewing incidence grids.
- metadata_paths: dict[str, str] = {'archiving_centre': './n1:General_Info/Archiving_Info/ARCHIVING_CENTRE', 'archiving_time': './n1:General_Info/Archiving_Info/ARCHIVING_TIME', 'cloudy_pixel_percentage': './n1:Quality_Indicators_Info/Image_Content_QI/CLOUDY_PIXEL_PERCENTAGE', 'datastrip_id': './n1:General_Info/DATASTRIP_ID', 'degraded_msi_data_percentage': './n1:Quality_Indicators_Info/Image_Content_QI/DEGRADED_MSI_DATA_PERCENTAGE', 'downlink_priority': './n1:General_Info/DOWNLINK_PRIORITY', 'horizontal_cs_code': './n1:Geometric_Info/Tile_Geocoding/HORIZONTAL_CS_CODE', 'horizontal_cs_name': './n1:Geometric_Info/Tile_Geocoding/HORIZONTAL_CS_NAME', 'mask_filenames': './n1:Quality_Indicators_Info/Pixel_Level_QI/MASK_FILENAME', 'mean_sun_azimuth': './n1:Geometric_Info/Tile_Angles/Mean_Sun_Angle/AZIMUTH_ANGLE', 'mean_sun_zenith': './n1:Geometric_Info/Tile_Angles/Mean_Sun_Angle/ZENITH_ANGLE', 'ncols_10': "./n1:Geometric_Info/Tile_Geocoding/Size[@resolution='10']/NCOLS", 'ncols_20': "./n1:Geometric_Info/Tile_Geocoding/Size[@resolution='20']/NCOLS", 'ncols_60': "./n1:Geometric_Info/Tile_Geocoding/Size[@resolution='60']/NCOLS", 'nrows_10': "./n1:Geometric_Info/Tile_Geocoding/Size[@resolution='10']/NROWS", 'nrows_20': "./n1:Geometric_Info/Tile_Geocoding/Size[@resolution='20']/NROWS", 'nrows_60': "./n1:Geometric_Info/Tile_Geocoding/Size[@resolution='60']/NROWS", 'pvi_filename': './n1:Quality_Indicators_Info/PVI_FILENAME', 'sensing_time': './n1:General_Info/SENSING_TIME', 'snow_pixel_percentage': './n1:Quality_Indicators_Info/Image_Content_QI/SNOW_PIXEL_PERCENTAGE', 'sun_azimuth_col_step': './n1:Geometric_Info/Tile_Angles/Sun_Angles_Grid/Azimuth/COL_STEP', 'sun_azimuth_row_step': './n1:Geometric_Info/Tile_Angles/Sun_Angles_Grid/Azimuth/ROW_STEP', 'sun_azimuth_values_rows': './n1:Geometric_Info/Tile_Angles/Sun_Angles_Grid/Azimuth/Values_List/VALUES', 'sun_zenith_col_step': './n1:Geometric_Info/Tile_Angles/Sun_Angles_Grid/Zenith/COL_STEP', 'sun_zenith_row_step': './n1:Geometric_Info/Tile_Angles/Sun_Angles_Grid/Zenith/ROW_STEP', 'sun_zenith_values_rows': './n1:Geometric_Info/Tile_Angles/Sun_Angles_Grid/Zenith/Values_List/VALUES', 'tile_id': './n1:General_Info/TILE_ID', 'ulx_10': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='10']/ULX", 'ulx_20': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='20']/ULX", 'ulx_60': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='60']/ULX", 'uly_10': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='10']/ULY", 'uly_20': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='20']/ULY", 'uly_60': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='60']/ULY", 'xdim_10': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='10']/XDIM", 'xdim_20': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='20']/XDIM", 'xdim_60': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='60']/XDIM", 'ydim_10': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='10']/YDIM", 'ydim_20': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='20']/YDIM", 'ydim_60': "./n1:Geometric_Info/Tile_Geocoding/Geoposition[@resolution='60']/YDIM"}#
Mapping from metadata keys to XPath expressions. Intended to be overridden by subclasses.