eoio.processors.units.drivers.gistda_theos module#
eoio.processors.units.drivers.gistda_theos - unit conversion for GISTDA THEOS products
- class eoio.processors.units.drivers.gistda_theos.GISTDATHEOSUnitDriver[source]#
Bases:
BaseUnitConversionDriverGISTDA THEOS unit conversion driver.
Intended scope: - radiance -> reflectance, using attributes available in the product
This driver assumes eoio readers provide enough product identification to allow cheap matching (e.g. ds.attrs[‘eoio:product’] in {“gistda_theos”}).
Notes
GISTDA THEOS unit conversion depends on: - solar_zenith_angle & solar irradiance
Where those values live should be standardised in dataset and variable attrs.
- convert(ds: Dataset, to: str, var_names: Sequence[str] | None, *, context: Mapping[str, Any]) Dataset[source]#
Convert selected variables in the dataset to the requested target units, based on supported conversion pairs. If no variables are selected, the default is all measurement vars. Converts the data using conversion coefficients found in metadata (per band gain and bias, solar zenith, etc.) and updates units attributes accordingly.
- Parameters:
ds – Input dataset.
to – Target unit name (e.g. “reflectance”).
var_names – Variables to convert. If None default is all measurement vars.
context – Processing context provided by eoio, passed to all processors.
- Returns:
Dataset with converted variables.
- Raises:
ValueError – If an unsupported conversion is requested.
KeyError – If requested variables are not present.
- matches(ds: Dataset, context: Mapping[str, Any]) bool[source]#
Determine whether this driver can handle the given dataset.
Matching should be cheap and unambiguous; avoid heavy inspection.
- Parameters:
ds – Input dataset.
context – Processing context provided by eoio.
- Returns:
True if this looks like a GISTDA THEOS dataset, otherwise False.
- name: str = 'gistda_theos'#