1
Fork 0

Plot input wave in olaflow in legible form

This commit is contained in:
Edgar P. Burkhart 2022-05-03 09:19:03 +02:00
parent 99e271e902
commit a6d2041666
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 3 additions and 3 deletions

View File

@ -57,11 +57,11 @@ org = org.replace("{v}", "\n".join(v.astype(np.str_)))
org = org.replace("{eta}", "\n".join(wl.astype(np.str_))) org = org.replace("{eta}", "\n".join(wl.astype(np.str_)))
olaflow_root.joinpath("constant", "waveDict").write_text(org) olaflow_root.joinpath("constant", "waveDict").write_text(org)
fig, ax = plt.subplots() fig, (ax, ax2) = plt.subplots(2)
ax.plot(t, wl) ax.plot(t, wl)
ax.autoscale(True, "x", tight=True) ax.autoscale(True, "x", tight=True)
ax.set(xlabel="t (s)", ylabel="z (m)") ax.set(xlabel="t (s)", ylabel="z (m)")
ax2 = ax.twinx()
ax2.plot(t, v) ax2.plot(t, v)
ax2.set(ylabel="U (m/s)") ax2.autoscale(True, "x", tight=True)
ax2.set(xlabel="t (s)", ylabel="U (m/s)")
fig.savefig(olaflow_root.joinpath("constant", "wave.pdf")) fig.savefig(olaflow_root.joinpath("constant", "wave.pdf"))