1
Fork 0

Add spectrum plot

This commit is contained in:
Edgar P. Burkhart 2022-04-05 10:41:13 +02:00
parent 98426a1ab7
commit c1f2c793c9
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -40,3 +40,12 @@ with out_spec.open("w") as out:
df = np.diff(inp['f']).min() df = np.diff(inp['f']).min()
log.info(f"Minimum frequency delta: {df:.4f}Hz") log.info(f"Minimum frequency delta: {df:.4f}Hz")
log.info(f"Maximum modelled time: {1/df:.0f}s") 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()