wavespectra.SpecArray#

class wavespectra.SpecArray(xarray_obj)[source]#

Extends DataArray with methods to deal with wave spectra.

__init__(xarray_obj)[source]#

Initialise spec accessor.

Methods

__init__(xarray_obj)

Initialise spec accessor.

celerity([depth])

Wave celerity C from frequency coords.

crsd([theta])

Add description.

dm()

Mean wave direction from the 1st spectral moment Dm.

dp()

Peak wave direction Dp.

dpm()

Peak wave direction Dpm.

dspr()

Directional wave spreading Dspr.

hmax()

Maximum wave height Hmax.

hs([tail])

Spectral significant wave height Hm0.

interp([freq, dir, maintain_m0])

Interpolate onto new spectral basis.

interp_like(other[, maintain_m0])

Interpolate onto coordinates from other spectra.

momd([mom, theta])

Calculate given directional moment.

momf([mom])

Calculate given frequency moment.

oned([skipna])

Returns the one-dimensional frequency spectra.

partition(wsp_darr, wdir_darr, dep_darr[, ...])

Partition wave spectra using Hanson's watershed algorithm.

plot([kind, normalised, logradius, ...])

Plot spectra in polar axis.

scale_by_hs(expr[, hs_min, hs_max, tp_min, ...])

Scale spectra using expression based on Significant Wave Height hs.

split([fmin, fmax, dmin, dmax, rechunk])

Split spectra over freq and/or dir dims.

stats(stats[, fmin, fmax, dmin, dmax, names])

Calculate multiple spectral stats into a Dataset.

sw([mask])

Spectral width parameter by Longuet-Higgins (1975).

swe()

Spectral width parameter by Cartwright and Longuet-Higgins (1956).

tm01()

Mean absolute wave period Tm01.

tm02()

Mean absolute wave period Tm02.

to_energy([standard_name])

Convert from energy density (m2/Hz/degree) into wave energy spectra (m2).

tp([smooth])

Peak wave period Tp.

wavelen([depth])

Wavelength L from frequency coords.

Attributes

dd

Direction resolution float.

df

Frequency resolution numpy array.

dfarr

Frequency resolution DataArray.

dir

Direction DataArray.

freq

Frequency DataArray.