Renamed pos_x x0
This commit is contained in:
parent
301c2a5e47
commit
77ff8b1e1f
1 changed files with 9 additions and 9 deletions
|
@ -39,13 +39,13 @@ n_t = botl.shape[0]
|
|||
t = np.arange(0, n_t * dt, dt)
|
||||
|
||||
# Cospectral calculations
|
||||
pos_x = config.getint("post", "x0")
|
||||
x0 = config.getint("post", "x0")
|
||||
t0 = config.getint("post", "t0")
|
||||
f = 1 / dt
|
||||
log.info(f"Computing reflection coefficient at x={pos_x}")
|
||||
log.info(f"Computing reflection coefficient at x={x0}")
|
||||
|
||||
eta = (dep - botl)[t > t0, pos_x]
|
||||
u = vel[t > t0, 0, pos_x]
|
||||
eta = (dep - botl)[t > t0, x0]
|
||||
u = vel[t > t0, 0, x0]
|
||||
|
||||
phi_eta = np.abs(sgl.csd(eta, eta, f))
|
||||
phi_u = np.abs(sgl.csd(u, u, f))
|
||||
|
@ -60,13 +60,13 @@ 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")
|
||||
ax_dep.plot(t, (dep - botl)[:, x0], 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, c='k', alpha=.2)
|
||||
|
||||
ax_vel.plot(t, vel[:, 0, pos_x], label="vel")
|
||||
ax_vel.plot(t, vel[:, 0, x0], label="vel")
|
||||
ax_vel.set(xlabel="t (s)", ylabel="U (m/s)")
|
||||
ax_vel.autoscale(axis="x", tight=True)
|
||||
ax_vel.grid()
|
||||
|
@ -93,8 +93,8 @@ out = pathlib.Path(config.get("post", "out"))
|
|||
log.info(f"Saving plots in '{out}'")
|
||||
out.mkdir(exist_ok=True)
|
||||
|
||||
fig.savefig(out.joinpath(f"t{pos_x}.png"))
|
||||
fig_r.savefig(out.joinpath(f"R{pos_x}.png"))
|
||||
fig_x.savefig(out.joinpath(f"x{pos_x}.png"))
|
||||
fig.savefig(out.joinpath(f"t{x0}.png"))
|
||||
fig_r.savefig(out.joinpath(f"R{x0}.png"))
|
||||
fig_x.savefig(out.joinpath(f"x{t0}.png"))
|
||||
|
||||
log.info("Finished post-processing")
|
||||
|
|
Loading…
Reference in a new issue