From ef2e23ab15d36d871517331cf6ae108da9ae5074 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 7 Mar 2022 11:10:01 +0100 Subject: [PATCH] Fixed sws_ola conversion --- olaflow/processing/sws_ola.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/olaflow/processing/sws_ola.py b/olaflow/processing/sws_ola.py index f0083e2..0eb4ddb 100644 --- a/olaflow/processing/sws_ola.py +++ b/olaflow/processing/sws_ola.py @@ -32,6 +32,8 @@ of_x, of_y, of_z = mesh = readof.readmesh(str(olaflow_root)) watl = interpolate.interp1d(x, sws["watl"][680]) +alpha_water = np.where(of_z < watl(of_x), "1", "0") + with open(olaflow_root.joinpath("0", "alpha.water"), "r") as aw_file: aw_raw = aw_file.read() @@ -39,7 +41,7 @@ with open(olaflow_root.joinpath("0", "alpha.water"), "w") as aw_file: aw_file.write( re.sub( r"(?<=\(\n).*?(?=\n\))", - "\n".join(map(str, alpha_water)), + "\n".join(alpha_water), aw_raw, count=1, flags=re.S,