eoio.readers.sentinel3_olci.data_io module#
Sentinel-3 OLCI image reading utilities.
This module contains helpers to read radiance bands, uncertainty bands,
latitude/longitude coordinates into an xarray
Dataset.
Functions follow Sphinx/reST docstring conventions (:param:,
:type:, :returns:, :rtype:).
- eoio.readers.sentinel3_olci.data_io.read_bands_into_dataset(*, ds: Dataset, layout: S3OLCILayout, meas: List[str], subset: ResolvedROISubset | None, mtd: S3OLCIMetadataExtractor, chunks: Dict[str, int] | None = None, use_chunks: bool = False) Dataset[source]#
Read radiance bands into an xarray
Dataset.- Parameters:
ds – Base dataset to which band variables will be added. The dataset is mutated and returned.
layout – Layout helper used to locate band files on disk.
meas – Sequence of band tokens to read (e.g.
['Oa01']).subset – Optional resolved ROI subset object; when present and containing a
clip_boxattribute the band arrays will be clipped to that box.mtd – Metadata extractor used to retrieve band-specific metadata.
chunks – Optional chunking specification passed to the raster reader.
use_chunks – Whether to compute and apply chunking heuristics.
- Returns:
The dataset with the requested bands attached.
- eoio.readers.sentinel3_olci.data_io.read_lat_lon_coordinates(*, ds: Dataset, layout: S3OLCILayout, subset: ResolvedROISubset | None = None, config: ReaderConfig, chunks: Dict[str, int] | None = None, use_chunks: bool = False) Tuple[Dataset, Dict[str, Any] | None][source]#
Read latitude/longitude coordinate arrays and attach to
ds.Reads the product’s
geo_coordinates.ncfile via rioxarray and normalises the stored integer coordinates to degrees. Optionally applies ROI clipping based on a resolved subset and returns a clip-box suitable for later use by image readers.- Parameters:
ds – Base dataset to which
longitude_300mandlatitude_300mwill be assigned and set as coordinates.layout – Layout helper used to locate the
geo_coordinates.ncfile.subset – Optional resolved ROI subset; when provided the function will compute and return an
(x_min, y_min, x_max, y_max)clip box.chunks – Optional chunking specification for raster reads.
use_chunks – Whether to compute and apply chunking heuristics.
- Returns:
Tuple with the updated dataset and an optional clip-box when a subset was supplied.
- eoio.readers.sentinel3_olci.data_io.read_tie_geo_coordinates(*, ds: Dataset, layout: S3OLCILayout, subset: ResolvedROISubset | None = None, config: ReaderConfig, chunks: Dict[str, int] | None = None, use_chunks: bool = False) Tuple[Dataset, Any | None][source]#
Read tie-point grid coordinates and add them to
ds.Reads the
tie_geo_coordinates.ncfile via rioxarray and extracts tie-point longitude and latitude arrays, applying any requested ROI clipping. The coordinates are scaled using the storedscale_factorattributes and are renamed tox_tie/y_tiecoordinate names before being merged intods.- Parameters:
ds – Dataset to which tie-point longitude and latitude will be added.
layout – Layout helper for locating the
tie_geo_coordinates.ncfile.subset – Optional resolved ROI subset for clipping; may be
None.config – Reader configuration containing variable selection and read parameters.
chunks – Optional chunking specification for raster reads.
use_chunks – Whether to compute and apply chunking heuristics.
- Returns:
Tuple of (updated dataset, tie-point clip box) where the clip box is returned when
subsetwas provided, otherwiseNone.
- eoio.readers.sentinel3_olci.data_io.read_uncertainty_into_dataset(*, ds: Dataset, layout: S3OLCILayout, meas: List[str], subset: ResolvedROISubset | None, chunks: Dict[str, int] | None = None, use_chunks: bool = False) Dataset[source]#
Read uncertainty (error) bands and attach them to
ds.unc.- Parameters:
ds – Dataset to which uncertainty arrays will be attached.
layout – Layout helper for locating uncertainty files.
meas – Bands for which uncertainties should be read.
subset – Optional ROI subset used for clipping.
chunks – Chunking specification for raster reads.
use_chunks – Whether to compute and apply chunking heuristics.
- Returns:
Dataset containing attached uncertainty variables.