fluidsim.base.output.spatiotemporal_spectra

Spatiotemporal Spectra

Provides:

class fluidsim.base.output.spatiotemporal_spectra.SpatioTemporalSpectra3D(output)[source]

Bases: SpecificOutput

Computes the spatiotemporal spectra.

_tag = 'spatiotemporal_spectra'
nb_dim = 3
classmethod _complete_params_with_default(params)[source]
_init_files(arrays_1st_time=None)[source]
_init_new_file(tmin_file=None)[source]

Initializes a new file

_write_to_file(data)[source]

Writes a file with the temporal data

_add_probes_data_to_dict(data, key)[source]

Probes fields in Fourier space and append data to a dict object

_online_save()[source]

Prepares data and writes to file

load_time_series(keys=None, tmin=0, tmax=None, dtype=None)[source]

load time series from files

_compute_spectrum(data)[source]
compute_spectra(tmin=0, tmax=None, dtype=None)[source]

compute spatiotemporal spectra from files

_get_data_probe_from_field(field)[source]
class fluidsim.base.output.spatiotemporal_spectra.SpatioTemporalSpectra2D(output)[source]

Bases: SpatioTemporalSpectra3D

nb_dim = 2
_get_data_probe_from_field(field)[source]
class fluidsim.base.output.spatiotemporal_spectra.SpatioTemporalSpectraNS[source]

Bases: object

_get_path_saved_spectra(tmin, tmax, dtype, save_urud)[source]
_get_path_saved_tspectra(tmin, tmax, dtype, save_urud)[source]
save_spectra_kzkhomega(tmin=0, tmax=None, dtype=None, save_urud=False)[source]
save:
  • the spatiotemporal spectra, with a cylindrical average in k-space

  • the temporal spectra, with an average on the whole k-space

load_spectra_kzkhomega(tmin=0, tmax=None, dtype=None, save_urud=False)[source]

load kzkhomega spectra from file

compute_omega_emp_vs_kzkh(spectra_kzkhomega, key_spect='spectrum_b')[source]

Compute empirical frequency and fluctuation from the spatiotemporal spectra:

\[ \begin{align}\begin{aligned}\omega_{emp}(k_h, k_z) = \frac{\int ~ \omega ~ S(k_h, k_z, \omega) ~ \mathrm{d}\omega}{\int ~ S(k_h, k_z, \omega) ~ \mathrm{d}\omega},\\\delta \omega_{emp}(k_h, k_z) = \sqrt{\frac{\int ~ (\omega - \omega_{emp})^2 ~ S(k_h, k_z, \omega) ~ \mathrm{d}\omega}{\int ~ S(k_h, k_z, \omega) ~ \mathrm{d}\omega}},\end{aligned}\end{align} \]

where \(\omega_{emp}\) is the empirical frequency and \(\delta \omega_{emp}\) is the empirical frequency fluctuation. \(S(k_h, k_z, \omega)\) is the spectra of key_spect.

plot_kzkhomega(key_field='b', tmin=0, tmax=None, dtype=None, equation=None, xmax=None, ymax=None, cmap=None, vmin=None, vmax=None, plot_omega_emp=False, linscale=False)[source]

plot the spatiotemporal spectra, with a cylindrical average in k-space

equation must start with ‘omega=’, ‘kh=’, ‘kz=’, ‘ikh=’ or ‘ikz=’.

For 3d solvers, key_field can be in State.keys_state_phys + [“Khd”, “Khr”, “Kp”].

compute_spectra_urud(tmin=0, tmax=None, dtype=None)[source]
compute_temporal_spectra(tmin=0, tmax=None, dtype=None, compute_urud=False)[source]

compute the temporal spectra by averaging over Fourier space

_get_default_tmin_periodogram(tmin)[source]
plot_temporal_spectra(key_field=None, tmin=None, tmax=None, xlim=None, ylim=None, dtype=None, xscale='log', coef_compensate=0, plot_resonant_modes=True)[source]

plot the temporal spectra computed from the 4d spectra

load_temporal_spectra(tmin=None, tmax=None, dtype=None, save_urud=False)[source]

load temporal spectra from file

save_temporal_spectra(tmin=0, tmax=None, dtype=None, save_urud=False)[source]

compute temporal spectra from files

_get_default_tmax()[source]
get_spectra(tmin=0, tmax=None, dtype=None)[source]

Functions

filter_tmins_paths(tmin, tmins, paths)

find_index_first_g(arr, value)

find the first index such that arr[index] > value

find_index_first_geq(arr, value)

find the first index such that arr[index] >= value

find_index_first_l(arr, value)

find the first index such that arr[index] < value

get_arange_minmax(times, tmin, tmax)

get a range of index for which tmin <= times[i] <= tmax

sort_files_tmin(paths[, tmins])

Classes

SpatioTemporalSpectra2D(output)

SpatioTemporalSpectra3D(output)

Computes the spatiotemporal spectra.

SpatioTemporalSpectraNS()