|
|
@ -1592,16 +1592,24 @@ class TimeSeries(PlotData):
|
|
|
|
>>> import wafo.objects as wo
|
|
|
|
>>> import wafo.objects as wo
|
|
|
|
>>> x = wd.sea()
|
|
|
|
>>> x = wd.sea()
|
|
|
|
>>> ts = wo.mat2timeseries(x)
|
|
|
|
>>> ts = wo.mat2timeseries(x)
|
|
|
|
|
|
|
|
>>> true_SH = [
|
|
|
|
|
|
|
|
... [[ 0.01186982, 0.04852534], [ 0.69, 0.86]],
|
|
|
|
|
|
|
|
... [[ 0.02918363, 0.06385979], [ 0.69, 0.86]],
|
|
|
|
|
|
|
|
... [[ 0.27797411, 0.33585743], [ 0.69, 0.86]],
|
|
|
|
|
|
|
|
... [[ 0.60835634, 0.60930197], [ 0.42, 0.78]],
|
|
|
|
|
|
|
|
... [[ 0.60835634, 0.60930197], [ 0.42, 0.78]],
|
|
|
|
|
|
|
|
... [[ 0.10140867, 0.06141156], [ 0.42, 0.78]],
|
|
|
|
|
|
|
|
... [[ 0.01821413, 0.01236672], [ 0.42, 0.78]]]
|
|
|
|
>>> for i in range(-3,4):
|
|
|
|
>>> for i in range(-3,4):
|
|
|
|
... S, H = ts.wave_height_steepness(method=i)
|
|
|
|
... S, H = ts.wave_height_steepness(method=i)
|
|
|
|
... print(S[:2],H[:2])
|
|
|
|
... np.allclose((S[:2],H[:2]), true_SH[i+3])
|
|
|
|
[ 0.01186982 0.04852534]), [ 0.69, 0.86]
|
|
|
|
True
|
|
|
|
[ 0.02918363, 0.06385979]) [ 0.69, 0.86]
|
|
|
|
True
|
|
|
|
[ 0.27797411, 0.33585743]) [ 0.69, 0.86]
|
|
|
|
True
|
|
|
|
[ 0.60835634, 0.60930197]) [ 0.42, 0.78]
|
|
|
|
True
|
|
|
|
[ 0.60835634, 0.60930197]) [ 0.42, 0.78]
|
|
|
|
True
|
|
|
|
[ 0.10140867, 0.06141156]) [ 0.42, 0.78]
|
|
|
|
True
|
|
|
|
[ 0.01821413, 0.01236672]) [ 0.42, 0.78]
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
|
|
import pylab as plt
|
|
|
|
import pylab as plt
|
|
|
|
h = plt.plot(S,H,'.')
|
|
|
|
h = plt.plot(S,H,'.')
|
|
|
|