Commit 190bec86 authored by Jason Reneuve's avatar Jason Reneuve
Browse files

plot dispersion relation as a step function

parent fe3265e88c02
...@@ -250,13 +250,13 @@ class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra): ...@@ -250,13 +250,13 @@ class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra):
return return
if equation.startswith(r"$\omega"): if equation.startswith(r"$\omega"):
kz_disp = (N ** 2 / omega ** 2 - 1) * xaxis kz_disp = (N ** 2 / omega ** 2 - 1) * xaxis
ax.plot(xaxis, kz_disp, "k:", linewidth=2) ax.step(xaxis, kz_disp, "k", linewidth=2)
elif equation.startswith(r"$k_h"): elif equation.startswith(r"$k_h"):
omega_disp = kh / np.sqrt(kh ** 2 + xaxis ** 2) omega_disp = kh / np.sqrt(kh ** 2 + xaxis ** 2)
ax.plot(xaxis, omega_disp, "k:", linewidth=2) ax.step(xaxis, omega_disp, "k", linewidth=2)
elif equation.startswith(r"$k_z"): elif equation.startswith(r"$k_z"):
omega_disp = xaxis / np.sqrt(xaxis ** 2 + kz ** 2) omega_disp = xaxis / np.sqrt(xaxis ** 2 + kz ** 2)
ax.plot(xaxis, omega_disp, "k:", linewidth=2) ax.step(xaxis, omega_disp, "k", linewidth=2)
else: else:
raise ValueError("wrong equation for dispersion relation") raise ValueError("wrong equation for dispersion relation")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment