Skip to content

Landsat Validation

Module: spectralbridge.landsat_validation.

Optional Landsat acquisition and common-support drone validation.

The core drone pipeline does not depend on this module succeeding. Network search, remote COG access, cloud screening, and optional NEON comparison are QA activities performed only after valid Landsat-like drone products exist.

API glossary ยท Workflow / scientific context

Signatures and documentation below are collected from the current source. Advanced objects are not newly declared stable by inclusion here.

Audience: advanced.

LandsatObservation dataclass

LandsatObservation(product_id: str, target_sensor: str, acquisition_datetime: str | None, cloud_cover: float | None, raster_path: str, metadata_path: str | None, source: str, temporal_offset_days: float | None, band_common_names: tuple[str, ...], target_band_indices: tuple[int, ...], wavelengths_nm: tuple[float, ...], scene_selection: str)

A cropped, QA-masked actual Landsat surface-reflectance product.

Audience: advanced.

acquire_landsat_observation

acquire_landsat_observation(*, bounds_wgs84: Sequence[float], acquisition_datetime: datetime | str, search_days: int, target_sensors: Iterable[str], output_dir: str | Path, cloud_cover_max: float = 50.0) -> LandsatObservation | None

Discover and cache the best overlapping Landsat Collection 2 L2 crop.

Audience: advanced.

load_supplied_landsat_observation

load_supplied_landsat_observation(path: str | Path, *, target_sensors: Iterable[str]) -> LandsatObservation

Load an acquisition manifest or a user-supplied multiband raster.

Audience: advanced.

raster_bounds_wgs84

raster_bounds_wgs84(path: str | Path) -> tuple[float, float, float, float]

Transform raster bounds to (west, south, east, north) in WGS84 degrees; reject a missing CRS.

Audience: advanced.

raster_acquisition_datetime

raster_acquisition_datetime(path: str | Path) -> str | None

Read an acquisition timestamp tag or conservative YYYYMMDD filename token.

Audience: advanced.

compare_landsat_common_support

compare_landsat_common_support(*, translated_img: str | Path, plan: DroneTranslationPlan, observation: LandsatObservation, output_dir: str | Path, neon_product: str | Path | None = None, drone_acquisition_datetime: str | None = None, neon_acquisition_datetime: str | None = None, valid_fraction_threshold: float = 0.5) -> dict[str, Any]

Aggregate drone/optional NEON products to the actual Landsat grid.

Explicitly exported constants and type aliases

These values describe package metadata, schemas or configuration; they are not observations from a production dataset.

Name Source expression
PLANETARY_COMPUTER_STAC 'https://planetarycomputer.microsoft.com/api/stac/v1'
LANDSAT_COLLECTION 'landsat-c2-l2'
LANDSAT_SURFACE_REFLECTANCE_SCALE 2.75e-05
LANDSAT_SURFACE_REFLECTANCE_OFFSET -0.2