Skip to content
Snippets Groups Projects
Commit ae0dedfb authored by Pierre Augier's avatar Pierre Augier
Browse files

Improve ns3d output spectra plotting

parent 9b80c0e2
No related branches found
No related tags found
1 merge request!156Topic/default/phaseshift3d
......@@ -225,7 +225,7 @@
if ylim is not None:
ax.set_ylim(ylim)
def plot_kzkh(self, tmin=0, tmax=None, key="K", ax=None):
def plot_kzkh(self, tmin=0, tmax=None, key="K", ax=None, vmin=None, vmax=None):
data = self.load_kzkh_mean(tmin, tmax, key)
spectrum = np.log10(data[key])
kz = data["kz"]
......@@ -233,6 +233,8 @@
if ax is None:
fig, ax = self.output.figure_axe()
else:
fig = ax.figure
ax.set_xlabel(r"$\kappa_h$")
ax.set_ylabel("$k_z$")
......@@ -236,5 +238,5 @@
ax.set_xlabel(r"$\kappa_h$")
ax.set_ylabel("$k_z$")
ax.set_title("log 3D spectra\n" + self.output.summary_simul)
ax.set_title("log10 spectra\n" + self.output.summary_simul)
......@@ -240,5 +242,6 @@
ax.pcolormesh(kh, kz, spectrum)
qmesh = ax.pcolormesh(kh, kz, spectrum, vmin=vmin, vmax=vmax)
fig.colorbar(qmesh)
def plot1d(
self,
......@@ -324,5 +327,5 @@
ks_no0[ks == 0] = np.nan
coef_norm = ks_no0 ** (coef_compensate)
style_line = ""
style_line = "r"
if direction == "z":
......@@ -328,6 +331,6 @@
if direction == "z":
style_line = ":"
style_line = "g"
ax.plot(
ks,
spectrum * coef_norm,
......@@ -330,8 +333,8 @@
ax.plot(
ks,
spectrum * coef_norm,
"k" + style_line,
style_line,
linewidth=2,
label=f"$E(k_{direction})$",
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment