eoio.readers.landsat.layout module#
eoio.readers.landsat.layout - Helper for Landsat product layout parsing.
- class eoio.readers.landsat.layout.LandsatLayout(path: str)[source]#
Bases:
objectLayout helper for Landsat products (e.g. Landsat 8 OLI/TIRS L1/L2).
Responsible for filesystem/path logic. No heavy dependencies.
- available_band_tokens() Set[str][source]#
Return the unique set of available band tokens based on the product files, e.g.: {‘B1’, ‘B2’, ‘B3’, …’B11’}
- Returns:
Set of available band tokens.
- default_meas_vars() List[str][source]#
Return the default measurement variables for Landsat to read if user does not specify.
- Returns:
List of default measurement variables inferred from filenames.
- get_angle_files() Dict[str, str][source]#
Return a dictionary of angle file paths for illumination and viewing angles.
Matches both uppercase (.TIF) and lowercase (.tif) extensions so the method works on case-sensitive filesystems (e.g. OneDrive on macOS/Linux).
- Returns:
Dict of angle file paths.
- Raises:
LandsatLayoutError – If any expected angle file is missing.
- path: str#
- property product_dir: Path#
- product_metadata_json() Path | None[source]#
Return the product metadata JSON file for the Landsat product (STAC preferred), or
Noneif the product doesn’t have one.Missing rather than raising: every value this file supplies (per-band GSD/central wavelength, EPSG, proj:shape/proj:transform) has an equivalent source elsewhere – MTL.xml’s own GRID_CELL_SIZE_* fields, fixed OLI/TIRS instrument-spec band centres, and the product’s own GeoTIFF band files’ raster metadata respectively – see
eoio.readers.landsat.metadata.ls_mtd_fallback, whicheoio.readers.landsat.metadata.extractor.LSMetadataExtractorfalls back to when this returnsNone. In practice this file is usually genuinely present in a USGS Collection 2 Level-1 delivery; its absence more often means an interrupted local extraction left some archive members missing (seeeoio.utils.read_utils._extraction_is_complete(), which now detects and heals that) than a real product-format difference.- Returns:
Path to the product metadata JSON file, or
Noneif not found.