1
Fork 0

Fixed optional comparison

This commit is contained in:
Edgar P. Burkhart 2022-03-10 10:55:34 +01:00
parent fdfbd081d9
commit bf4e9e6958
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -111,6 +111,8 @@ ax_fft.plot(
alpha=0.2, alpha=0.2,
label="PSD ($\\eta$, cas 1)", label="PSD ($\\eta$, cas 1)",
) )
ax_r.plot(phi_eta[0], R, marker="+", label="R (cas 1)")
if config.has_option("post", "compare"):
ax_fft.plot( ax_fft.plot(
*sgl.welch(eta_, 1 / dt, nperseg=nperseg), *sgl.welch(eta_, 1 / dt, nperseg=nperseg),
lw=1, lw=1,
@ -118,7 +120,6 @@ ax_fft.plot(
alpha=0.2, alpha=0.2,
label="PSD ($\\eta$, cas 2)", label="PSD ($\\eta$, cas 2)",
) )
ax_r.plot(phi_eta[0], R, marker="+", label="R (cas 1)")
ax_r.plot(phi_eta[0], R_, marker="+", label="R (cas 2)") ax_r.plot(phi_eta[0], R_, marker="+", label="R (cas 2)")
ax_r.set(xlim=(0, 0.3), ylim=(0, 1), xlabel="f (Hz)", ylabel="R") ax_r.set(xlim=(0, 0.3), ylim=(0, 1), xlabel="f (Hz)", ylabel="R")
ax_fft.set(ylim=0, ylabel="PSD (m²/Hz)") ax_fft.set(ylim=0, ylabel="PSD (m²/Hz)")
@ -129,11 +130,12 @@ fig_r.tight_layout()
fig_x, ax_x = plt.subplots(figsize=(10, 1)) fig_x, ax_x = plt.subplots(figsize=(10, 1))
ax_x.plot(data["x"], -data["botl"], color="k") ax_x.plot(data["x"], -data["botl"], color="k")
ax_x.plot(data["x"], -data_comp["botl"], color="k", ls="-.")
ax_x.plot( ax_x.plot(
data["x"], data["x"],
np.maximum(data["watl"][arg_t0, :], -data["botl"]), np.maximum(data["watl"][arg_t0, :], -data["botl"]),
) )
if config.has_option("post", "compare"):
ax_x.plot(data["x"], -data_comp["botl"], color="k", ls="-.")
ax_x.plot( ax_x.plot(
data["x"], data["x"],
np.maximum(data_comp["watl"][arg_t0, :], -data_comp["botl"]), np.maximum(data_comp["watl"][arg_t0, :], -data_comp["botl"]),