wecopttool.waves.long_crested_wave
- long_crested_wave(efth, nrealizations, direction=0.0, seed=None)[source]
Create a complex frequency-domain wave elevation from an omnidirectional spectrum.
The spectrum is a
xarray.DataArray
in the format used bywavespectra.SpecArray
.Note
The frequencies must be evenly-spaced with spacing equal to the first frequency. This is not always the case when e.g. reading from buoy data. Use interpolation as
da.interp(freq=[...])
.- Parameters:
efth (DataArray) – Omnidirection wave spectrum in units of m^2/Hz, in the format used by
wavespectra.SpecArray
.nrealizations (int) – Number of wave phase realizations to be created for the long-crested wave.
direction (float | None) – Direction (in degrees) of the long-crested wave.
seed (float | None) – Seed for random number generator. Used for reproducibility. Generally should not be used except for testing.
- Return type:
DataArray