Skip to content

Commit 902c3d5

Browse files
committed
VFQ: Small changes to add monochromatic series to HySwash
1 parent 0298f03 commit 902c3d5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

bluemath_tk/waves/series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ def series_regular_monochromatic(waves):
335335
# waves properties
336336
T = waves["T"]
337337
H = waves["H"]
338-
WL = waves["WL"]
338+
#WL = waves["WL"]
339339
warmup = waves["warmup"]
340340
deltat = waves["deltat"]
341-
tendc = waves["tendc"]
341+
tendc = waves["comptime"]
342342

343343
# series duration
344344
duration = tendc + int(warmup)

bluemath_tk/wrappers/swash/swash_wrapper.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import xarray as xr
88
from scipy.signal import find_peaks
99

10-
from ...waves.series import series_TMA, waves_dispersion
10+
from ...waves.series import series_TMA, waves_dispersion, series_regular_monochromatic
1111
from ...waves.spectra import spectral_analysis
1212
from ...waves.statistics import upcrossing
1313
from .._base_wrappers import BaseModelWrapper
@@ -206,7 +206,9 @@ def build_case(
206206
"gamma": case_context["gamma"],
207207
"deltat": case_context["deltat"],
208208
}
209-
waves = series_TMA(waves=waves_dict, depth=self.depth_array[0])
209+
#waves = series_TMA(waves=waves_dict, depth=self.depth_array[0])
210+
waves = series_regular_monochromatic(waves=waves_dict)
211+
210212
# Save the waves to a file
211213
self.write_array_in_file(
212214
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:
736738
# Build the input vegetation file
737739
plants = np.zeros((len(self.depth_array)))
738740
plants[
739-
int(self.fixed_parameters["Plants_ini"]) : int(
740-
self.fixed_parameters["Plants_fin"]
741-
)
742-
] = case_context["plants_density"]
741+
int(
742+
case_context["Plants_end"] - case_context["Wv"]
743+
) : int(case_context["Plants_end"])
744+
] = case_context["Nv"]
743745
np.savetxt(os.path.join(case_dir, "plants.txt"), plants, fmt="%.6f")
744746

745747

0 commit comments

Comments
 (0)