Conventions#
Wavespectra takes advantage of xarray’s labelled coordinates to abstract n-dimensional wave spectra datasets. This requires some conventions around special coordinates and variables. The convention adopted is based on that of the NetCDF output from the WAVEWATCH III spectral wave model.
Datasets and DataArrays that follow these naming and units conventions gain the
spec accessor with the full wavespectra functionality. The table below summarises
the special names:
Name |
Type |
Units |
Description |
|---|---|---|---|
|
variable |
\(m^{2}/Hz/degree\) (2D), \(m^{2}/Hz\) (1D) |
Wave energy density \(E(f,\theta)\) or \(E(f)\); the core spectral variable, required by all methods. |
|
coordinate |
\(Hz\) |
Wave frequency, required by all methods. |
|
coordinate |
\(degree\) |
Wave direction in coming-from convention; required for 2D spectra and directional methods. |
|
coordinate |
Times of the spectra, required by a few methods such as partition tracking. |
|
|
coordinate |
Index of spectral sites; used by the selecting functionality. |
|
|
coordinate / variable |
\(degree\) |
Longitude and latitude of the spectral sites; required by the selecting functionality. |
|
variable |
\(m s^{-1}\) |
Wind speed, required by the partitioning methods that split sea and swell
( |
|
variable |
\(degree\) |
Wind direction in coming-from convention, required by the same partitioning
methods as |
|
variable |
\(m\) |
Water depth, required by the sea/swell partitioning methods and by
wavenumber-based methods such as
|
Directions#
Directional quantities (dir, wdir and derived parameters such as dm and
dpm) follow the nautical, coming-from convention: the direction waves (or wind)
come from, measured clockwise from true North, in degrees. For example, waves with
dir=0 travel southwards and waves with dir=270 come from the West.
Attributes#
Pre-defined names and units for these and other coordinates and variables are
provided in the wavespectra.core.attributes module:
In [1]: from wavespectra.core.attributes import attrs
In [2]: attrs.SPECNAME
Out[2]: 'efth'
In [3]: attrs.ATTRS.hs
Out[3]:
{'standard_name': 'sea_surface_wave_significant_height',
'units': 'm',
'_ipython_canary_method_should_not_exist_': {}}