diff --git a/swash/processing/post.py b/swash/processing/post.py index ad60c73..9e64f8d 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -111,15 +111,16 @@ ax_fft.plot( alpha=0.2, label="PSD ($\\eta$, cas 1)", ) -ax_fft.plot( - *sgl.welch(eta_, 1 / dt, nperseg=nperseg), - lw=1, - c="k", - alpha=0.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)") +if config.has_option("post", "compare"): + ax_fft.plot( + *sgl.welch(eta_, 1 / dt, nperseg=nperseg), + lw=1, + c="k", + alpha=0.2, + label="PSD ($\\eta$, 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_fft.set(ylim=0, ylabel="PSD (m²/Hz)") ax_r.grid() @@ -129,16 +130,17 @@ fig_r.tight_layout() fig_x, ax_x = plt.subplots(figsize=(10, 1)) ax_x.plot(data["x"], -data["botl"], color="k") -ax_x.plot(data["x"], -data_comp["botl"], color="k", ls="-.") ax_x.plot( data["x"], np.maximum(data["watl"][arg_t0, :], -data["botl"]), ) -ax_x.plot( - data["x"], - np.maximum(data_comp["watl"][arg_t0, :], -data_comp["botl"]), - ls="-.", -) +if config.has_option("post", "compare"): + ax_x.plot(data["x"], -data_comp["botl"], color="k", ls="-.") + ax_x.plot( + data["x"], + np.maximum(data_comp["watl"][arg_t0, :], -data_comp["botl"]), + ls="-.", + ) ax_x.axvline(x0, c="k", alpha=0.2) ax_x.set(xlabel="x (m)", ylabel="z (m)") ax_x.autoscale(axis="x", tight=True)