xoa.grid.decode_dz2depth

xoa.grid.decode_dz2depth#

xoa.grid.decode_dz2depth(ds, errors='raise', **kwargs)[source]#

Compute depth from layer thickness in a dataset

This makes use of the MetaSpecs() instance that is retrieved with xoa.meta.get_meta_specs() with ds as an argument in order to find needed variables.

Parameters:
  • ds (xarray.Dataset) – Dataset that contains everything

  • errors ({'ignore', 'warn', 'raise'}) –

    In case of errors

    • 'ignore': silently ignore

    • 'warn': emit a warning

    • 'raise': raise an exception

  • kwargs (dict) – Extra keywords are passed to dz2depth()

Returns:

xarray.Dataset – A new dataset with a depth coordinate