Skip to content

Commit

Permalink
Describe allowed values in teos10 accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
DocOtak committed Dec 9, 2020
1 parent e1e057d commit b786116
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 22 additions & 2 deletions argopy/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,33 @@ def interp_std_levels(self, std_lev):
def teos10(self, vlist: list = ['SA', 'CT', 'SIG0', 'N2', 'PV', 'PTEMP'], inplace: bool = True):
""" Add TEOS10 variables to the dataset
By default, add: 'SA', 'CT', 'SIG0', 'N2', 'PV', 'PTEMP'
Rely on the gsw library.
By default, adds: 'SA', 'CT', 'SIG0', 'N2', 'PV', 'PTEMP'
Relies on the gsw library.
If one exists, the correct CF standard name will be added to the attrs.
Parameters
----------
vlist: list(str)
List with the name of variables to add.
Must be a list containing one or more of the following string values:
* `"SA"`
Adds an absolute salinity variable
* `"CT"`
Adds a conservative temperature variable
* `"SIG0"`
Adds a potential density anomaly variable referenced to 0 dbar
* `"N2"`
Adds a buoyancy (Brunt-Vaisala) frequency squared variable.
This variable has been regridded to the original pressure levels in the Dataset using a linear interpolation.
* `"PV"`
Adds a planetary vorticity variable calculated from :math:`\\frac{f N^2}{\\text{gravity}}`.
This is not a TEOS-10 variable from the gsw toolbox, but is provided for convenience.
This variable has been regridded to the original pressure levels in the Dataset using a linear interpolation.
* `"PTEMP"`
Adds a potential temperature variable
inplace: boolean, True by default
If True, return the input :class:`xarray.Dataset` with new TEOS10 variables added as a new :class:`xarray.DataArray`
If False, return a :class:`xarray.Dataset` with new TEOS10 variables
Expand Down
4 changes: 4 additions & 0 deletions docs/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ v0.1.7 (XX Nov. 2020)
**Breaking changes with previous versions**

- In the teos10 xarray accessor, the ``standard_name`` attribute will now be populated using values from the `CF Standard Name table <https://cfconventions.org/Data/cf-standard-names/76/build/cf-standard-name-table.html>`_ if one exists.
The previous values of ``standard_name`` have been moved to the ``long_name`` attribute.
(:pr:`74`) by `A. Barna <https://github.com/docotak>`_.

- The unique resource identifier property is now named ``uri`` for all data fetchers, it is always a list of strings.

**Internals**
Expand Down

0 comments on commit b786116

Please sign in to comment.