xoa.sigma.decode_cf_sigma

xoa.sigma.decode_cf_sigma(ds, rename=False, hlocs=None, errors='raise')[source]

Compute heights from sigma-like variable in a dataset

This makes use of the CFSpecs() instance that is retreived with xoa.cf.get_cf_specs() with ds as 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 have the same dimensions is found, the the computed coordinate is transposed properly and assigned to the variable as a a coordinate array.

Parameters:
  • ds (xarray.Dataset) – Dataset that contains everything needed to compute heights

  • rename (bool) – Rename and format arrays ot make them compliant with xoa.cf

  • hlocs (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