diff --git a/swash/config.ini b/swash/config.ini index 52190b4..b155e45 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -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 diff --git a/swash/processing/post.py b/swash/processing/post.py index ad31c8c..7b70cca 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -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)