Closed ryancoe closed 1 year ago
I looked into wavespectra
in detail. I think we should use it but... I don't think we can completely replace having our own structure. We want to be able to handle any type of wave including regular waves and more complex structures like, e.g. the sum of a finite number of regular waves from different directions, with direction not necessarily evenly spaced. To allow for these and irregular (directional or unidirectional) waves, probably the best option is for the core
to use discrete wave spectra (units of m^2
) or simply elevation amplitude (units of m
) indexed by frequencies (evenly spaced) and directions (arbitrary). We should then have functions in waves
to convert from continuous 1D (units m^2/Hz
) or 2D (units m^2/Hz/degree
) to an xarray of discrete elevations. These functions should accept wavespectra.specArray
and wavespectra.specDataset
.
Also, our methods for creating parametric spectra are more general than those in wavespectra.construct
(only two parametric spectrum functions and a hardcoded spread function, and poor documentation). We should maybe improve wavespectra.construct
and move our methods there.
wavespectra.construct
has many bugs, but there might be a plan to rewrite this submodule.
@cmichelenstrofer helped me wrap my head around this
Long crested uses the omnidirectional spectrum S(ω) [m²/Hz]
and direction θ [deg]
.
completed/fixed in v2.0. We will need to help develop wavespectra
to fix some issues. Will open separate issue.
I looked into
wavespectra
in detail. I think we should use it but... I don't think we can completely replace having our own structure. We want to be able to handle any type of wave including regular waves and more complex structures like, e.g. the sum of a finite number of regular waves from different directions, with direction not necessarily evenly spaced. To allow for these and irregular (directional or unidirectional) waves, probably the best option is for thecore
to use discrete wave spectra (units ofm^2
) or simply elevation amplitude (units ofm
) indexed by frequencies (evenly spaced) and directions (arbitrary). We should then have functions inwaves
to convert from continuous 1D (unitsm^2/Hz
) or 2D (unitsm^2/Hz/degree
) to an xarray of discrete elevations. These functions should acceptwavespectra.specArray
andwavespectra.specDataset
.
- To convert the continuous 1D to a discrete spectra simply multiply by the fixed frequency spacing Δf.
- To convert the continuous 2D to a discrete spectra simple multiply by the fixed frequency spacing and fixed direction spacing Δf*Δθ.
@cmichelenstrofer , @ryancoe ,
What are your thoughts about: https://github.com/wavespectra/wavespectra/pull/40 and https://github.com/RubendeBruin/wavespectra/blob/bin_to_continuous/docs/spectral_energy_and_bins.rst in praticular?
To store information about waves with which to run simulations, we've created our own custom
xr.DataSet
in thewaves
module. Thewavespectra
project has done something more than this, but along a similar vein. We may want to adopt their structure. One big benefit would be directly using many hindcast and measurement data sources (see I/O formats here: https://wavespectra.readthedocs.io/en/latest/io-input.html#).