Black reformat on processing

This commit is contained in:
Edgar P. Burkhart 2022-04-07 11:51:03 +02:00
parent eff2b09c8f
commit 358b57f23d
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
7 changed files with 62 additions and 41 deletions

View file

@ -35,9 +35,9 @@ vel = np.load(inp.joinpath("vel_x.npy"))
# Cospectral calculations
x0 = config.getint("post", "x0")
arg_x0 = np.abs(x - x0).argmin()
t0 = int(config.getfloat("post", "t0")*1e3)
t0 = int(config.getfloat("post", "t0") * 1e3)
arg_t0 = np.abs(t - t0).argmin()
dt = np.diff(t).mean()*1e-3
dt = np.diff(t).mean() * 1e-3
f = 1 / dt
nperseg = config.getint("post", "nperseg", fallback=None)
log.info(f"Computing reflection coefficient at x={x0}")
@ -58,10 +58,10 @@ R = np.sqrt(
(np.abs(phi_eta[1]) + np.abs(phi_u[1]) - 2 * phi_eta_u[1].real)
/ (np.abs(phi_eta[1]) + np.abs(phi_u[1]) + 2 * phi_eta_u[1].real)
)
#R = np.sqrt(
# R = np.sqrt(
# (1 + G**2 - 2 * G * np.cos(th_eta_u))
# / (1 + G**2 + 2 * G * np.cos(th_eta_u))
#)
# )
if config.has_option("post", "compare"):
inp_comp = pathlib.Path(config.get("post", "compare"))
@ -91,27 +91,27 @@ if config.has_option("post", "compare"):
(np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) - 2 * phi_eta_u_[1].real)
/ (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) + 2 * phi_eta_u_[1].real)
)
#R_ = np.sqrt(
# R_ = np.sqrt(
# (1 + G_**2 - 2 * G_ * np.cos(th_eta_u_))
# / (1 + G_**2 + 2 * G_ * np.cos(th_eta_u_))
#)
# )
# Plotting
log.info("Plotting results")
fig, (ax_watl, ax_vel) = plt.subplots(2)
ax_watl.plot(t*1e-3, watl[:, arg_x0], lw=1, label="watl")
ax_watl.plot(t * 1e-3, watl[:, arg_x0], lw=1, label="watl")
ax_watl.set(xlabel="t (s)", ylabel="z (m)")
ax_watl.autoscale(axis="x", tight=True)
ax_watl.grid()
ax_watl.axvline(t0*1e-3, c="k", alpha=0.2)
ax_watl.axvline(t0 * 1e-3, c="k", alpha=0.2)
ax_vel.plot(t*1e-3, vel[:, arg_x0], lw=1, label="vel")
ax_vel.plot(t * 1e-3, vel[:, arg_x0], lw=1, label="vel")
ax_vel.set(xlabel="t (s)", ylabel="U (m/s)")
ax_vel.autoscale(axis="x", tight=True)
ax_vel.grid()
ax_vel.axvline(t0*1e-3, c="k", alpha=0.2)
ax_vel.axvline(t0 * 1e-3, c="k", alpha=0.2)
fig.tight_layout()