cmip_branded_variable_mapper.mapper#
Mapper from CMIP information to branded variables
In the absence of other references, this is currently our source of truth for this mapping. (https://docs.google.com/document/d/149Tkz37whSQMFVbEYZMYbdqIctHbufpbJ_VMlzHyKuY/edit?tab=t.0).
Functions:
| Name | Description |
|---|---|
map_to_cmip_branded_variable |
Map CMIP variable information into a branded variable |
map_to_cmip_branded_variable #
map_to_cmip_branded_variable(
variable_name: str,
cell_methods: str | None,
dimensions: tuple[str, ...],
) -> str
Map CMIP variable information into a branded variable
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variable_name
|
str
|
Variable name |
required |
cell_methods
|
str | None
|
Cell methods associated with the variable |
required |
dimensions
|
tuple[str, ...]
|
Dimensions of the variable |
required |
Returns:
| Type | Description |
|---|---|
str
|
Branded variable |
Examples:
>>> map_to_cmip_branded_variable(
... variable_name="tas",
... cell_methods="area: time: mean",
... dimensions=("longitude", "latitude", "time", "height2m"),
... )
'tas_tavg-h2m-hxy-u'
>>>
>>> map_to_cmip_branded_variable(
... variable_name="hfds",
... cell_methods="area: mean where sea time: mean",
... dimensions=("longitude", "latitude", "time"),
... )
'hfds_tavg-u-hxy-sea'