_images/wavespectra_logo.png

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

efth

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.

freq

coordinate

\(Hz\)

Wave frequency, required by all methods.

dir

coordinate

\(degree\)

Wave direction in coming-from convention; required for 2D spectra and directional methods.

time

coordinate

Times of the spectra, required by a few methods such as partition tracking.

site

coordinate

Index of spectral sites; used by the selecting functionality.

lon, lat

coordinate / variable

\(degree\)

Longitude and latitude of the spectral sites; required by the selecting functionality.

wspd

variable

\(m s^{-1}\)

Wind speed, required by the partitioning methods that split sea and swell (ptm1, ptm2, ptm4, hp01).

wdir

variable

\(degree\)

Wind direction in coming-from convention, required by the same partitioning methods as wspd.

dpt

variable

\(m\)

Water depth, required by the sea/swell partitioning methods and by wavenumber-based methods such as celerity and wavelen.

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_': {}}