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,