From 4ab8973becdd66ffa91cce4dc35568a3be105c6a Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 2 Mar 2022 15:52:46 +0100 Subject: [PATCH] Postprocessing swash --- swash/config.ini | 2 +- swash/processing/post.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/swash/config.ini b/swash/config.ini index ef13eee..c9a4361 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -15,4 +15,4 @@ root=cache [swash] input=sws/INPUT.sws swashrun=/opt/swash/swash/swashrun -out=out +out=out.long diff --git a/swash/processing/post.py b/swash/processing/post.py index 4276f2d..ebd4292 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -17,10 +17,20 @@ 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 = read_nohead_scalar(root.joinpath("dep.dat"), n) -watl = read_nohead_scalar(root.joinpath("watl.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, label="dep") -plt.plot(-botl.T[:, 0], label="botl") +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)