LFS wtf
This commit is contained in:
parent
71049d49ea
commit
ba675fb763
68 changed files with 5727 additions and 204 deletions
|
@ -1,3 +1,36 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f12e993be338666db237374bcef3d50b16fe8c8f24f96425bdffb8d0adb47917
|
||||
size 977
|
||||
import argparse
|
||||
import configparser
|
||||
import logging
|
||||
import pathlib
|
||||
|
||||
import numpy as np
|
||||
from scipy import interpolate
|
||||
|
||||
from .olaflow import OFModel
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Convert swash output to olaFlow input"
|
||||
)
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
|
||||
log = logging.getLogger("sws_ola")
|
||||
|
||||
log.info("Starting sws -> olaFlow converter")
|
||||
config = configparser.ConfigParser()
|
||||
config.read("config.ini")
|
||||
|
||||
sws_out = pathlib.Path(config.get("swash", "np_out"))
|
||||
x = np.load(sws_out.joinpath("xp.npy"))
|
||||
t = np.load(sws_out.joinpath("tsec.npy"))
|
||||
watl = np.load(sws_out.joinpath("watl.npy"))
|
||||
|
||||
olaflow_root = pathlib.Path(config.get("olaflow", "root"))
|
||||
model = OFModel(olaflow_root)
|
||||
model.read_mesh()
|
||||
|
||||
watl_t = interpolate.interp1d(x, watl[680])
|
||||
alpha_water = np.where(model.z < watl_t(model.x), 1, 0)
|
||||
|
||||
model.write_field("alpha.water", alpha_water)
|
||||
|
|
Reference in a new issue