1
Fork 0

Added time scale to plots

This commit is contained in:
Edgar P. Burkhart 2022-03-03 15:15:53 +01:00
parent b0c316ff37
commit 87e108c8dc
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -34,11 +34,13 @@ 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)
dt = config.getfloat("post", "dt")
n_t = botl.shape[0]
t = np.arange(0, n_t*dt, dt)
# Cospectral calculations
pos_x = config.getint("post", "x0")
f = 1 / config.getfloat("post", "dt")
f = 1 / dt
log.info(f"Computing reflection coefficient at x={pos_x}")
eta = (dep - botl)[n_t // 2 :, pos_x]
@ -57,12 +59,12 @@ R = np.sqrt(
log.info("Plotting results")
fig, (ax_dep, ax_vel) = plt.subplots(2)
ax_dep.plot((dep - botl)[:, pos_x], label="dep", color="#0066ff")
ax_dep.plot(t, (dep - botl)[:, pos_x], label="dep", color="#0066ff")
ax_dep.set(xlabel="t (s)", ylabel="z (m)")
ax_dep.autoscale(axis="x", tight=True)
ax_dep.grid()
ax_vel.plot(vel[:, 0, pos_x], label="vel")
ax_vel.plot(t, vel[:, 0, pos_x], label="vel")
ax_vel.set(xlabel="t (s)", ylabel="U (m/s)")
ax_vel.autoscale(axis="x", tight=True)
ax_vel.grid()