1 apply_ancillary
apply_ancillary
1.1 Classes
| Name | Description |
|---|---|
| ApplyAncillary | Interpolator for ancillary data retrieved from a provider at a given datetime. |
1.1.1 ApplyAncillary
apply_ancillary.ApplyAncillary(dt, ancillary_provider)Interpolator for ancillary data retrieved from a provider at a given datetime.
This class extends Interpolator to handle ancillary data that varies with time, by fetching the appropriate data from an ancillary provider for the specified datetime.
1.1.1.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| dt | datetime | xr.DataArray | The datetime or dataset to retrieve ancillary data for. If a dataset is provided, its datetime will be extracted using core.tools.datetime. |
required |
| ancillary_provider | object | An ancillary data provider object with a get() method that accepts a datetime and returns an xarray Dataset containing ancillary variables. |
required |
1.1.1.2 Examples
>>> from datetime import datetime
>>> from eoread.ancillary_nasa import Ancillary_NASA
>>> processor = ApplyAncillary(datetime(2023, 1, 1), Ancillary_NASA())
>>> result = processor.map_blocks(dataset)
... # result contains all variables provided by Ancillary_NASA(), interpolated
... # over the variables provided by `dataset`.1.2 Functions
| Name | Description |
|---|---|
| apply_ancillary | Apply ancillary data from ancillary to dataset ds |
1.2.1 apply_ancillary
apply_ancillary.apply_ancillary(
ds,
ancillary,
variables,
interp_dims=None,
overwrite=None,
tag='ancillary',
**kwargs,
)Apply ancillary data from ancillary to dataset ds
Arguments:
ds: destination dataset
ancillary: ancillary data provider. If None, just check that all variables are
already provided in ds.
variables: dictionary containing the list of variables to get and
interpolate in `ancillary`, and their units (as interpreted
by the `pint` library).
Example:
{
'horizontal_wind': 'm/s',
'sea_level_pressure': 'hectopascals',
'total_column_ozone': 'Dobson',
}
interp_dims: maps the dimensions in `ancillary` to the variables in `ds`.
Example:
{"latitude": "latitude", "longitude": "longitude"}
overwrite: whether to overwrite existing variables
(True, False, None: raise an Error in case of existing variable)
tag: Defines the tag to be added to the output variables.