1
Fork 0
internship/swash/processing/post.py

37 lines
908 B
Python

import configparser
import pathlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from .read_swash import *
config = configparser.ConfigParser()
config.read("config.ini")
cache = pathlib.Path(config.get("out", "root"))
root = pathlib.Path(config.get("swash", "out"))
bathy = pd.read_hdf(cache.joinpath("bathy.h5"), "bathy")
n = bathy.index.size
# xp = read_nohead_scalar(root.joinpath("xp.dat"), n)
botl = read_nohead_scalar(root.joinpath("botl.dat"), n)
dep = np.maximum(0, read_nohead_scalar(root.joinpath("dep.dat"), n))
# watl = read_nohead_scalar(root.joinpath("watl.dat"), n)
plt.plot((dep.T - botl.T)[:, 4000], label="dep", color="#0066ff")
plt.plot(-botl.T[:, 0], label="botl", color="k")
plt.fill_between(
np.arange(n),
-botl.T[:, 0],
bathy.hstru.values - botl.T[:, 0],
label="hstru",
color="k",
alpha=0.1,
)
plt.legend()
plt.show(block=True)