1
Fork 0

Added t0 to post

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

View file

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