xoa.sigma.decode_sigma#
- xoa.sigma.decode_sigma(ds, rename=False, hlocs=None, errors='raise')[source]#
Compute heights from sigma-like variable in a dataset using CF conventions
This makes use of the
MetaSpecsinstance that is retrieved withxoa.meta.get_meta_specs()withdsas an argument in order to find needed variables. If the dataset is not found to have sigma-like coordinates, a simple copy is returned.When a data variable that has the same dimensions is found, the computed coordinate is transposed properly and assigned to the variable as a coordinate array.
- Parameters:
ds (xarray.Dataset) – Dataset that contains everything needed to compute heights
rename (bool) – Rename and format arrays to make them compliant with
xoa.metahlocs (None, list of str) – Horizontal staggered grid locations to search for “bathy” and “ssh”. By default, no location is assumed.
errors ({'ignore', 'warn', 'raise'}) –
In case of errors
'ignore': silently ignore'warn': emit a warning'raise': raise an exception
- Returns:
xarray.Dataset