1
Fork 0

Redid post processing comparison

This commit is contained in:
Edgar P. Burkhart 2022-03-25 13:48:28 +01:00
parent f905d20c81
commit d17d25b8e2
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 13 additions and 7 deletions

View file

@ -20,7 +20,7 @@ mpi=4
[post]
inp=inp_post
#compare=inp_post_2
compare=inp_post_nb
out=out_post
#nperseg=1024
dt=0.25

View file

@ -64,13 +64,19 @@ R = np.sqrt(
)
if config.has_option("post", "compare"):
data_comp = np.load(inp.joinpath(config.get("post", "compare")))
x_, t_ = data_comp["x"], data_comp["t"]
inp_comp = pathlib.Path(config.get("post", "compare"))
x_ = np.load(inp_comp.joinpath("xp.npy"))
t_ = np.load(inp_comp.joinpath("tsec.npy"))
botl_ = np.load(inp_comp.joinpath("botl.npy"))
watl_ = np.load(inp_comp.joinpath("watl.npy"))
vel_ = np.load(inp_comp.joinpath("vel.npy"))
arg_x0_ = np.abs(x_ - x0).argmin()
arg_t0_ = np.abs(t_ - t0).argmin()
eta_ = data_comp["watl"][t_ > t0, arg_x0_]
u_ = data_comp["vel"][t_ > t0, 0, arg_x0_]
eta_ = watl_[t_ > t0, arg_x0_]
u_ = vel_[t_ > t0, 0, arg_x0_]
phi_eta_ = sgl.welch(eta_, f, nperseg=nperseg)
phi_u_ = sgl.welch(u_, f, nperseg=nperseg)
@ -139,10 +145,10 @@ ax_x.plot(
np.maximum(watl[arg_t0, :], -botl),
)
if config.has_option("post", "compare"):
ax_x.plot(x, -data_comp["botl"], color="k", ls="-.")
ax_x.plot(x, -botl_, color="k", ls="-.")
ax_x.plot(
x,
np.maximum(data_comp["watl"][arg_t0, :], -data_comp["botl"]),
np.maximum(watl_[arg_t0, :], -botl_),
ls="-.",
)
ax_x.axvline(x0, c="k", alpha=0.2)