units_converter
Classes:
Name | Description |
---|---|
UnitsConverter |
Converts the units of a retrieved variable to specified output units. |
Classes#
UnitsConverter #
Bases: DataConverter
Converts the units of a retrieved variable to specified output units.
If the 'input_units' property is set then that string is used to determine the input
input units, otherwise the converter will attempt to look up and use the 'units'
attribute on the specified variable in the dataset provided to the convert
method.
If the input units cannot be set then a warning is issued and the original dataset
is returned. The output units are specified by the output dataset configuration.
Methods:
Name | Description |
---|---|
convert |
|
Attributes:
Name | Type | Description |
---|---|---|
input_units |
Optional[str]
|
The units of the input data. |
Attributes#
input_units
class-attribute
instance-attribute
#
The units of the input data.
Functions#
convert #
convert(
data: xr.DataArray,
variable_name: str,
dataset_config: DatasetConfig,
retrieved_dataset: RetrievedDataset,
**kwargs: Any
) -> Optional[xr.DataArray]