Fixed sws_ola conversion
This commit is contained in:
parent
b6577f4679
commit
ef2e23ab15
1 changed files with 3 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue