diff --git a/swash/processing/animate.py b/swash/processing/animate.py index 2d6aad0..e2a7526 100644 --- a/swash/processing/animate.py +++ b/swash/processing/animate.py @@ -20,6 +20,8 @@ config.read("config.ini") inp = pathlib.Path(config.get("post", "inp")) root = pathlib.Path(config.get("swash", "out")) +out = pathlib.Path(config.get("plot", "out")) +out.mkdir(exist_ok=True) def data(var): @@ -52,4 +54,4 @@ ani = animation.FuncAnimation( fig, animate, frames=wl[:, 0].size, interval=20, blit=True ) -plt.show(block=True) +ani.save(out.joinpath("anim.mp4")) diff --git a/swash/processing/layers.py b/swash/processing/layers.py index a6b125b..897ecdb 100644 --- a/swash/processing/layers.py +++ b/swash/processing/layers.py @@ -21,6 +21,7 @@ config.read("config.ini") inp = pathlib.Path(config.get("post", "inp")) root = pathlib.Path(config.get("swash", "out")) out = pathlib.Path(config.get("plot", "out")) +out.mkdir(exist_ok=True) def data(var): diff --git a/swash/processing/post.py b/swash/processing/post.py index 7392fdb..796b90d 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -54,14 +54,14 @@ U = np.sqrt(np.abs(phi_u[1])) G = H / U th_eta_u = np.angle(phi_eta_u[1]) -# R1 = np.sqrt( -# (np.abs(phi_eta[1]) + np.abs(phi_u[1]) - 2 * np.abs(phi_eta_u[1])) -# / (np.abs(phi_eta[1]) + np.abs(phi_u[1]) + 2 * np.abs(phi_eta_u[1])) -# ) R = np.sqrt( - (1 + G**2 - 2 * G * np.cos(th_eta_u)) - / (1 + G**2 + 2 * G * np.cos(th_eta_u)) + (np.abs(phi_eta[1]) + np.abs(phi_u[1]) - 2 * np.abs(phi_eta_u[1])) + / (np.abs(phi_eta[1]) + np.abs(phi_u[1]) + 2 * np.abs(phi_eta_u[1])) ) +#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")) @@ -88,9 +88,13 @@ if config.has_option("post", "compare"): th_eta_u_ = np.angle(phi_eta_u_[1]) R_ = np.sqrt( - (1 + G_**2 - 2 * G_ * np.cos(th_eta_u_)) - / (1 + G_**2 + 2 * G_ * np.cos(th_eta_u_)) + (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) - 2 * np.abs(phi_eta_u_[1])) + / (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) + 2 * np.abs(phi_eta_u_[1])) ) + #R_ = np.sqrt( + # (1 + G_**2 - 2 * G_ * np.cos(th_eta_u_)) + # / (1 + G_**2 + 2 * G_ * np.cos(th_eta_u_)) + #) # Plotting