From f3d1a8672dbb8348417cc95c72fb12edf89d7bcd Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 2 Jun 2021 23:04:01 +0200 Subject: [PATCH] Linear scale temporal spectra --- fluidsim/base/output/spatiotemporal_spectra.py | 3 ++- fluidsim/base/output/temporal_spectra.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fluidsim/base/output/spatiotemporal_spectra.py b/fluidsim/base/output/spatiotemporal_spectra.py index fd9249f7..517eae96 100644 --- a/fluidsim/base/output/spatiotemporal_spectra.py +++ b/fluidsim/base/output/spatiotemporal_spectra.py @@ -1126,6 +1126,7 @@ class SpatioTemporalSpectraNS: tmin=0, tmax=None, dtype=None, + xscale="log", ): """plot the temporal spectra computed from the 4d spectra""" keys_plot = self.keys_fields.copy() @@ -1161,7 +1162,7 @@ class SpatioTemporalSpectraNS: f"{key_field} temporal spectrum (tmin={tmin:.3f}, tmax={tmax:.3f})\n" + self.output.summary_simul ) - ax.set_xscale("log") + ax.set_xscale(xscale) ax.set_yscale("log") # specific to strat diff --git a/fluidsim/base/output/temporal_spectra.py b/fluidsim/base/output/temporal_spectra.py index 29d5fd70..2c6a43b4 100644 --- a/fluidsim/base/output/temporal_spectra.py +++ b/fluidsim/base/output/temporal_spectra.py @@ -599,7 +599,9 @@ class TemporalSpectra3D(SpecificOutput): p_oper = self.sim.params.oper return (0, p_oper.Lx, 0, p_oper.Ly, 0, p_oper.Lz) - def plot_spectra(self, key=None, region=None, tmin=0, tmax=None, dtype=None): + def plot_spectra( + self, key=None, region=None, tmin=0, tmax=None, dtype=None, xscale="log" + ): """plot temporal spectra from files""" if key is None: key = self.keys_fields[0] @@ -623,7 +625,7 @@ class TemporalSpectra3D(SpecificOutput): fig, ax = self.output.figure_axe() ax.set_xlabel(r"$\omega$") ax.set_ylabel("spectrum") - ax.set_xscale("log") + ax.set_xscale(xscale) ax.set_yscale("log") ax.set_title( f"{key} temporal spectrum (tmin={tmin:.3f}, tmax={tmax:.3f})\n" -- GitLab