1
Fork 0

Added x plot

This commit is contained in:
Edgar P. Burkhart 2022-03-03 15:23:05 +01:00
parent 133edefec2
commit 745c4ee181
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -64,13 +64,13 @@ 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_dep.axvline(t0, c='k', alpha=.2)
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)
ax_vel.axvline(t0, c='k', alpha=.2)
fig.tight_layout()
@ -81,11 +81,20 @@ ax_r.autoscale(axis="x", tight=True)
ax_r.set(ylim=(0, 1), xlabel="f (Hz)", ylabel="R")
ax_r.grid()
fig_x, ax_x = plt.subplots()
ax_x.plot(bathy.index, botl[0, :], color='k')
ax_x.plot(bathy.index, (dep-botl)[t == t0, :])
ax_x.axvline(x0)
ax_x.set(xlabel="x (m)", ylabel="z (m)")
ax_x.autoscale(axis="x", tight=True)
ax_x.grid()
out = pathlib.Path(config.get("post", "out"))
log.info(f"Saving plots in '{out}'")
out.mkdir(exist_ok=True)
fig.savefig(out.joinpath(f"{pos_x}.png"))
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"))
log.info("Finished post-processing")