diff --git a/bluemath_tk/waves/series.py b/bluemath_tk/waves/series.py index e8e0174..a2fb394 100644 --- a/bluemath_tk/waves/series.py +++ b/bluemath_tk/waves/series.py @@ -335,10 +335,10 @@ def series_regular_monochromatic(waves): # waves properties T = waves["T"] H = waves["H"] - WL = waves["WL"] + #WL = waves["WL"] warmup = waves["warmup"] deltat = waves["deltat"] - tendc = waves["tendc"] + tendc = waves["comptime"] # series duration duration = tendc + int(warmup) diff --git a/bluemath_tk/wrappers/swash/swash_wrapper.py b/bluemath_tk/wrappers/swash/swash_wrapper.py index baaec99..08a66b0 100644 --- a/bluemath_tk/wrappers/swash/swash_wrapper.py +++ b/bluemath_tk/wrappers/swash/swash_wrapper.py @@ -7,7 +7,7 @@ import xarray as xr from scipy.signal import find_peaks -from ...waves.series import series_TMA, waves_dispersion +from ...waves.series import series_TMA, waves_dispersion, series_regular_monochromatic from ...waves.spectra import spectral_analysis from ...waves.statistics import upcrossing from .._base_wrappers import BaseModelWrapper @@ -206,7 +206,9 @@ def build_case( "gamma": case_context["gamma"], "deltat": case_context["deltat"], } - waves = series_TMA(waves=waves_dict, depth=self.depth_array[0]) + #waves = series_TMA(waves=waves_dict, depth=self.depth_array[0]) + waves = series_regular_monochromatic(waves=waves_dict) + # Save the waves to a file self.write_array_in_file( array=waves, filename=os.path.join(case_dir, "waves.bnd") @@ -736,10 +738,10 @@ def build_case(self, case_context: dict, case_dir: str) -> None: # Build the input vegetation file plants = np.zeros((len(self.depth_array))) plants[ - int(self.fixed_parameters["Plants_ini"]) : int( - self.fixed_parameters["Plants_fin"] - ) - ] = case_context["plants_density"] + int( + case_context["Plants_end"] - case_context["Wv"] + ) : int(case_context["Plants_end"]) + ] = case_context["Nv"] np.savetxt(os.path.join(case_dir, "plants.txt"), plants, fmt="%.6f")