From 40cd75e393abc27db217a1315de9ac92c0c59f52 Mon Sep 17 00:00:00 2001 From: Andrew Simms Date: Wed, 29 Nov 2023 07:41:46 -0700 Subject: [PATCH] Fix: Convert spectrum into numpy array This fixes a bug where the conversion from MATLAB to python was not compatible. This follows the same pattern as `energy_period.m` --- mhkit/wave/resource/energy_period.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mhkit/wave/resource/energy_period.m b/mhkit/wave/resource/energy_period.m index 44ed72968..e628e021a 100644 --- a/mhkit/wave/resource/energy_period.m +++ b/mhkit/wave/resource/energy_period.m @@ -57,9 +57,9 @@ li=py.mhkit_python_utils.pandas_dataframe.lis(li,app); end - S=py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(double(S.frequency(:,1)),li,int32(x(2))); + S=py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(double(S.frequency(:,1)),li,x(2)); elseif x(2)==1 - S=py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(double(S.frequency),double(S.spectrum),int32(x(2))); + S=py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(double(S.frequency),py.numpy.array(S.spectrum),x(2)); end else