xarray.Dataset.decode_sigma.get_sigma_terms
- Dataset.decode_sigma.get_sigma_terms(loc=None, rename=False)
Call
get_sigma_terms()
on the datasetIt operates like this:
Search for the sigma variables.
Parse their
formula_terms
attribute.Create a dict for each locations from names in datasets to
xoa.cf
compliant names that are also used in conversion functions.
- Parameters:
ds (xarray.Dataset) –
loc (str, {"any", None}) – Staggered grid location. If any or None, results for all locations are returned.
- Returns:
dict, dict of dict – A dict is generated for a given sigma variable, whose keys are array names, like
"sc_r"
, and values arecf
names, like"sig"
. A special key is the"type"
whose corresponding value is thestandard_name
, stripped from its potential staggered grid location indicator. Ifloc
is"any"
orNone
, each dict is embedded in a master dict whose keys are staggered grid location. If no location is found, the key is setNone
.- Raises:
xoa.sigma.XoaSigmaError – In case of: - inconsistent staggered grid location in dataarrays as checked by
xoa.cf.SGLocator.get_location()
- no standard_name in sigma/s variable - a malformed formula - a formula term variable that is not found in the dataset - an unknown formula term name
See also