xarray.Dataset.decode_sigma.get_sigma_terms

Dataset.decode_sigma.get_sigma_terms(loc=None, rename=False)

Call get_sigma_terms() on the dataset

It operates like this:

  1. Search for the sigma variables.

  2. Parse their formula_terms attribute.

  3. 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 are cf names, like "sig". A special key is the "type" whose corresponding value is the standard_name, stripped from its potential staggered grid location indicator. If loc is "any" or None, each dict is embedded in a master dict whose keys are staggered grid location. If no location is found, the key is set None.

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