eoio.readers.flex.data_io module#
eoio.readers.flex.data_io#
Data I/O for FLEX L2 FLXSYN products.
Functions#
|
Read the product grid from the global attributes and the ancillary group. |
|
Read the wavelength coordinate for every spectral dimension, as stored in the product. |
|
Read the requested variables (and their uncertainty partners, if named) into a dataset. |
Register every |
|
|
Assumed error-correlation structure of an uncertainty component. |
- eoio.readers.flex.data_io.err_corr_for(dims: Iterable[str]) List[dict][source]#
Assumed error-correlation structure of an uncertainty component.
PLACEHOLDER: the product documents no correlation model. Until one is confirmed, uncertainties are assumed random across the spatial dimensions and fully systematic along any spectral dimension.
- Parameters:
dims – dimensions of the uncertainty variable.
- Returns:
obsarray
err_corrdefinition.
- eoio.readers.flex.data_io.read_dataset(path: str, include_vars: Iterable[str], grid: FlexGrid, wavelengths: Dict[str, DataArray], subset: FLEXSubset | None = None, chunks: Dict[str, int] | None = None) Dataset[source]#
Read the requested variables (and their uncertainty partners, if named) into a dataset.
Dimensions are renamed to
y/xplus one named dimension per spectral/trailing axis, packed integers are unpacked, and coordinates (x, y, latitude, longitude, wavelengths, labels) are attached. Subsetting is applied before data are loaded.- Parameters:
path – path to the FLEX product.
include_vars – variable names to read, including any
*_uncertaintypartners.grid – product grid.
wavelengths – wavelength coordinates, as returned by
read_wavelengths().subset – resolved subset, or
Nonefor the full product.chunks – dask chunk sizes along
y/x. If given, variables stay lazy (dask-backed, file left open) after subsetting; otherwise they are loaded into memory.
- Returns:
dataset with the requested variables.
- eoio.readers.flex.data_io.read_grid(path: str) FlexGrid[source]#
Read the product grid from the global attributes and the ancillary group.
- Parameters:
path – path to the FLEX product.
- Returns:
the product grid.
- eoio.readers.flex.data_io.read_wavelengths(path: str) Dict[str, DataArray][source]#
Read the wavelength coordinate for every spectral dimension, as stored in the product.
FLORIS wavelengths are stored per across-track sample (
across_track x channel), but only the first sample is populated in the products seen so far. They are collapsed to a single wavelength vector (mean over the populated samples); a warning is raised if populated samples differ, since a single vector then no longer describes the product. This is provisional: a spectral smile may require per-row wavelengths, to be revisited with real products (it is expected to be corrected in L1).- Parameters:
path – path to the FLEX product.
- Returns:
mapping from dimension name (e.g.
"wavelength_olci") to a 1-D wavelengthDataArrayin nm.
- eoio.readers.flex.data_io.register_uncertainties(ds: Dataset) Dataset[source]#
Register every
<var>_uncertaintyvariable as an obsarray uncertainty component of<var>.This makes them discoverable via
ds.unc[var]with machine-readable error-correlation metadata (seeerr_corr_for()for the assumptions made).- Parameters:
ds – dataset as returned by
read_dataset().- Returns:
dataset with uncertainty variables registered.