From c1f2c793c9ea5d95bf786e6cce5f6b4111f7e48b Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 5 Apr 2022 10:41:13 +0200 Subject: [PATCH] Add spectrum plot --- data/processing/spec.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/processing/spec.py b/data/processing/spec.py index b1c0a29..fca9580 100644 --- a/data/processing/spec.py +++ b/data/processing/spec.py @@ -40,3 +40,12 @@ with out_spec.open("w") as out: df = np.diff(inp['f']).min() log.info(f"Minimum frequency delta: {df:.4f}Hz") log.info(f"Maximum modelled time: {1/df:.0f}s") + +fig, ax = plt.subplots() +ax.plot(inp["f"], inp["S"], c="k", lw=1) +ax.autoscale(True, "x", tight=True) +ax.grid() +ax.set(xlim=0, ylim=0, xlabel="f (Hz)", ylabel="S (m^2/Hz)") + +fig.savefig(out_root.joinpath("spec.pdf")) +plt.show()