Closed ryancoe closed 2 months ago
Note that this is somewhat related: https://github.com/wavespectra/wavespectra/issues/107
Note that we should make sure any changes to close this issues are consistent across:
It may also make sense to combine these functions, as long_crested_wave
is just a special case of irregular_wave
, right?
closed by #326
I was trying to use
wot.waves.long_crested_wave
to create a wave based on an empirical spectrum. In the docstring forwot.waves.long_crested_wave
it says you should pass anOmnidirection wave spectrum in units of m^2/Hz, in the format used by :py:class:wavespectra.SpecArray
.https://github.com/sandialabs/WecOptTool/blob/598e875cd48751ddb652657391205f6e208714f0/wecopttool/waves.py#L197-L227
So I did something like the following:
This produces an error:
I was able to resolve the problem by doing just passing my raw
xr.DataArray
(not thewavespectra.SpecArray
):This is OK I guess, but if so our docstring is misleading.
Suggested options:
wot.waves.long_crested_wave
to make it clear that you should pass axr.DataArray
with a specific structure (don't love this one)wot.waves.long_crested_wave
to use awavespectra.SpecArray
as the input argument (preferred)