diff --git a/swash/config.ini b/swash/config.ini index c9a4361..ef13eee 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.long +out=out diff --git a/swash/processing/post.py b/swash/processing/post.py index ebd4292..81ac601 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -20,17 +20,17 @@ 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)) +vel = read_nohead_vect(root.joinpath("vel.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() +fig, (ax_dep, ax_vel) = plt.subplots(2) + +ax_dep.plot((dep - botl)[:, n//2], label="dep", color="#0066ff") +ax_dep.set(xlabel="t (s)", ylabel="z (m)") + +ax_vel.plot(vel[:, 0, n//2], label="vel") +ax_vel.set(xlabel="t (s)", ylabel="U (m/s)") + +fig.tight_layout() +#fig.legend() plt.show(block=True) diff --git a/swash/processing/read_swash.py b/swash/processing/read_swash.py index f101d4a..62ddf5f 100644 --- a/swash/processing/read_swash.py +++ b/swash/processing/read_swash.py @@ -21,8 +21,8 @@ def read_nohead_k(path, n, k): def read_nohead_vect(path, n): - return read_reshape(path, (-1, n, 2)) + return read_reshape(path, (-1, 2, n)) def read_nohead_vect_k(path, n): - return read_reshape(path, (-1, n, 2, k)) + return read_reshape(path, (-1, 2, n, k))