1
Fork 0

Fixed sws_ola conversion

This commit is contained in:
Edgar P. Burkhart 2022-03-07 11:10:01 +01:00
parent b6577f4679
commit ef2e23ab15
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -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,