eoio.readers.flex.reader module#
eoio.readers.flex.reader#
Reader for FLEX L2 FLXSYN products (NetCDF4).
The product is a synergy of FLORIS, OLCI and SLSTR data on a common 300 m UTM grid. Variables are
exposed under the following vars_sel selections:
measAll science variables: OLCI/SLSTR/FLORIS apparent reflectance, FLORIS real reflectance, SIF (spectrum, integrated, peaks, O2 bands), and the vegetation products. Shortcuts:
"all","olci","slstr","floris","fluorescence","vegetation".auxRetrieved atmospheric state (water vapour, AOT, Angstrom exponent, asymmetry parameter, cloud probability, LST, PAR), at-surface direct/diffuse irradiance, elevation and view geometry. Shortcuts:
"all","atmosphere","irradiance","geometry".maskcirrus_cloud_mask(the only mask in the product).
Every dataset also carries the x/y (projected, from the product’s GeoTransform) and
2-D latitude/longitude coordinates; the CRS comes from the file (crs attribute), as the
UTM zone differs between products.
Wavelength information is kept as in the product: each spectral grid has its own dimension
(wavelength_olci, wavelength_floris, …). Use the resample_wavelength processor to
put spectra on a common grid. FLORIS wavelengths are stored per across-track sample but are
treated as a single vector, as only the first sample is populated in the products seen so far; this
is provisional until real products show whether a spectral smile (per-row wavelengths) must be
handled (it is expected to be corrected in L1).
Values outside the product’s stated valid_min/valid_max are not altered (e.g.
cloud_probability below 0 and total_integrated_sif far above valid_max in the test
products). These are considered product issues to be raised with the producers, not corrected in
the reader.
The split of variables between meas, aux and mask follows the product’s science/auxiliary
division. Placement of cloud_probability (aux) relative to cloud masks is to be revisited as
part of a wider consistency discussion across readers.
The files carry no acquisition time, so product_datetime is taken from the start time in the
filename. Whether a start/stop range is needed is still to be confirmed.
Memory: by default the selected (subsetted) variables are loaded into memory. With
read_params={"use_chunks": True} (optionally "chunks": {"y": ..., "x": ...}, default
64 x 64) they stay lazy, dask-backed arrays and are only read when computed, so a full product
can be opened and then reduced without holding it all in memory. The file stays open while the
dataset is in use.
Uncertainties (include_uncertainties) are registered through obsarray as ds.unc
components. The product documents no error-correlation model, so a placeholder is assumed (random
across y/x, systematic across wavelength); see eoio.readers.flex.data_io.err_corr_for().
The spectral error correlation is computed and passed to the L2B retrieval but is not stored per
product (too expensive), so it cannot be read from the files; typical matrices per land-cover type
may replace the placeholder in future.
Classes#
|
Reader for FLEX L2 FLXSYN products. |
- class eoio.readers.flex.reader.FLEXL2Reader(path: Path | str, vars_sel: Dict[str, Any] | None = None, subset: Dict[str, Any] | None = None, read_params: Dict[str, Any] | None = None)[source]#
Bases:
BaseReaderReader for FLEX L2 FLXSYN products.
- all_read_params = {'chunks': "None/{'x':X,'y':Y}: dask chunk sizes (default 64 x 64 when use_chunks is True)", 'include_uncertainties': 'True/False', 'metadata_level': 'all/basic/None', 'save_extracted': 'True/False', 'use_chunks': 'True/False: keep variables lazy (dask-backed) instead of loading them into memory'}#
- all_subset: Dict[str, Any] = {'roi': 'Primary/shapely geometry/bounding box tuple (xmin, ymin, xmax, ymax)/GeoJSON-like ``dict`` with a ``type`` key/list of ``[x, y]`` coordinate pairs defining a polygon/``((x, y), half_width_m)`` defining a square box around a point', 'roi_crs': 'Any EPSG Code', 'wavelength': ['min', 'max', 'nearest', 'tolerance']}#
- aux_def: Dict[str, List[str]] = {'all': ['elevation', 'sun_zenith_angle', 'viewing_zenith_angle', 'relative_azimuth_angle', 'columnar_water_vapor', 'aerosol_optical_thickness', 'angstrom_exponent', 'asymmetry_parameter', 'cloud_probability', 'land_surface_temperature', 'integrated_par', 'direct_irradiance', 'diffuse_irradiance'], 'atmosphere': ['columnar_water_vapor', 'aerosol_optical_thickness', 'angstrom_exponent', 'asymmetry_parameter', 'cloud_probability', 'land_surface_temperature', 'integrated_par', 'direct_irradiance', 'diffuse_irradiance'], 'geometry': ['sun_zenith_angle', 'viewing_zenith_angle', 'relative_azimuth_angle'], 'irradiance': ['direct_irradiance', 'diffuse_irradiance']}#
- default_read_params: Dict[str, Any] = {'chunks': None, 'include_uncertainties': True, 'metadata_level': 'all', 'save_extracted': False, 'use_chunks': False}#
- default_subset: Dict[str, Any] = {'roi': None, 'roi_crs': 4326, 'wavelength': None}#
- default_vars_sel = {'aux': None, 'mask': None, 'meas': 'all'}#
- list_uncertainty_vars() List[str][source]#
Uncertainty variables of the selected meas/aux variables only.
- mask_def: Dict[str, List[str]] = {'all': ['cirrus_cloud_mask']}#
- meas_def: Dict[str, List[str]] = {'all': ['olci_apparent_reflectance', 'slstr_apparent_reflectance', 'floris_apparent_reflectance', 'sif_emission_spectrum', 'total_integrated_sif', 'sif_peak_values', 'sif_peak_positions', 'sif_O2_bands_value', 'floris_real_reflectance', 'leaf_area_index', 'leaf_chlorophyll_content', 'leaf_carotenoid_content', 'fapar_chlorophyll', 'apar_chlorophyll_photons', 'fraction_of_absorbed_photosynthetically_active_radiation', 'electron_transport_rate', 'fluorescence_quantum_efficiency', 'fluorescence_escape_probability', 'reversible_energy_dissipation', 'PSI_PSII_relative_contribution'], 'floris': ['floris_apparent_reflectance', 'floris_real_reflectance'], 'fluorescence': ['sif_emission_spectrum', 'total_integrated_sif', 'sif_peak_values', 'sif_peak_positions', 'sif_O2_bands_value', 'floris_real_reflectance'], 'olci': ['olci_apparent_reflectance'], 'slstr': ['slstr_apparent_reflectance'], 'vegetation': ['leaf_area_index', 'leaf_chlorophyll_content', 'leaf_carotenoid_content', 'fapar_chlorophyll', 'apar_chlorophyll_photons', 'fraction_of_absorbed_photosynthetically_active_radiation', 'electron_transport_rate', 'fluorescence_quantum_efficiency', 'fluorescence_escape_probability', 'reversible_energy_dissipation', 'PSI_PSII_relative_contribution']}#
- open_dataset() Dataset[source]#
Open the FLEX product as an
xarray.Datasetaccording to the request parameters.- Returns:
the opened and subsetted dataset.
- uncertainty_vars: List[str] = ['direct_irradiance_uncertainty', 'diffuse_irradiance_uncertainty', 'floris_apparent_reflectance_uncertainty', 'sif_emission_spectrum_uncertainty', 'total_integrated_sif_uncertainty', 'sif_peak_values_uncertainty', 'sif_peak_positions_uncertainty', 'sif_O2_bands_value_uncertainty', 'floris_real_reflectance_uncertainty', 'leaf_area_index_uncertainty', 'leaf_chlorophyll_content_uncertainty', 'leaf_carotenoid_content_uncertainty', 'fapar_chlorophyll_uncertainty', 'apar_chlorophyll_photons_uncertainty', 'fraction_of_absorbed_photosynthetically_active_radiation_uncertainty', 'electron_transport_rate_uncertainty', 'fluorescence_quantum_efficiency_uncertainty', 'fluorescence_escape_probability_uncertainty']#