wavespectra.SpecArray#
- class wavespectra.SpecArray(xarray_obj)[source]#
Extends DataArray with methods to deal with wave spectra.
Methods
__init__(xarray_obj)Initialise spec accessor.
alpha([smooth])Jonswap fetch dependant scaling coefficient alpha.
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.
dpspr([mom])Peak directional wave spread Dpspr.
dspr()Mean directional wave spread Dspr.
fdspr([mom])Directional wave spread at frequency \(dspr(f)\).
fit_gaussian([gw0, spectra, params])Nonlinear fit Gaussian width.
fit_jonswap([gamma0, spectra, params])Nonlinear fit Jonswap spectra.
fp([smooth])Peak wave frequency Fp.
gamma([smooth, scaled])Jonswap peak enhancement factor gamma.
goda()Goda peakedness parameter.
gw()Gaussian frequency spread by Bunney et al. (2014).
hmax()Maximum wave height Hmax.
hrms([tail])Root mean square wave height Hrms.
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])Directional moment.
momf([mom])Frequency moment.
mss([depth])Mean squared slope of sea surface.
oned([skipna])Returns the one-dimensional frequency spectra.
plot([kind, normalised, logradius, ...])Plot spectra in polar axis.
rmse(other)Root-Mean-Square Error among spectral bins.
rotate(angle)Rotate spectra.
scale_by_hs(expr[, hs_min, hs_max, tp_min, ...])Scale spectra using expression based on Significant Wave Height hs.
smooth([freq_window, dir_window])Smooth spectra with a running average.
split([fmin, fmax, dmin, dmax, interpolate, ...])Split spectra over freq and/or dir dims.
stats(stats[, fmin, fmax, dmin, dmax, names])Calculate multiple spectral stats into a Dataset.
sw()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.
Convert spectra from energy density (m2/Hz/degree) into wave energy (m2).
tp([smooth])Peak wave period Tp.
uss([depth])Stokes drift - speed, at sea surface.
uss_x([depth, theta])Stokes drift - x component, at sea surface.
uss_y([depth, theta])Stokes drift - y component, at sea surface.
wavelen([depth])Wavelength L from frequency coords.
Attributes
ddDirection resolution float.
dfFrequency resolution DataArray.
dirDirection DataArray.
freqFrequency DataArray.