LFS wtf
This commit is contained in:
parent
71049d49ea
commit
ba675fb763
68 changed files with 5727 additions and 204 deletions
|
|
@ -1,3 +1,60 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4ab57e0a813e6ea3086045717e251b2c44e00891a858d9f6365e3e604fefee03
|
||||
size 1316
|
||||
import argparse
|
||||
import configparser
|
||||
import logging
|
||||
import pathlib
|
||||
|
||||
import matplotlib.animation as animation
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
parser = argparse.ArgumentParser(description="Animate swash output")
|
||||
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("post")
|
||||
|
||||
log.info("Starting post-processing")
|
||||
config = configparser.ConfigParser()
|
||||
config.read("config.ini")
|
||||
|
||||
inp = pathlib.Path(config.get("post", "inp"))
|
||||
root = pathlib.Path(config.get("swash", "out"))
|
||||
|
||||
bathy = pd.read_hdf(
|
||||
pathlib.Path(config.get("data", "out")).joinpath("bathy.h5"), "bathy"
|
||||
)
|
||||
|
||||
|
||||
def data(var):
|
||||
return np.load(inp.joinpath(f"{var}.npy"))
|
||||
|
||||
|
||||
x = data("xp")
|
||||
t = data("tsec")
|
||||
|
||||
watl = data("watl")
|
||||
botl = data("botl")
|
||||
|
||||
wl = np.maximum(watl, -botl)
|
||||
# print(x.size, -np.arange(0, 1 * bathy.hstru.size, 1)[::-1].size)
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
ax.plot(x, -botl, c="k")
|
||||
# ax.fill_between(
|
||||
# x, -botl, -data["botl"] + bathy.hstru, color="k", alpha=0.2
|
||||
# )
|
||||
(line,) = ax.plot(x, wl[0])
|
||||
|
||||
|
||||
def animate(i):
|
||||
line.set_ydata(wl[i])
|
||||
return (line,)
|
||||
|
||||
|
||||
ani = animation.FuncAnimation(
|
||||
fig, animate, frames=wl[:, 0].size, interval=20, blit=True
|
||||
)
|
||||
|
||||
plt.show(block=True)
|
||||
|
|
|
|||
Reference in a new issue