Read about our upcoming Code of Conduct on this issue

Commit 6a6eed01 authored by Pierre Augier's avatar Pierre Augier
Browse files

spatiotemporal_spectra: last things before merging!

parent 9622adf3b868
Pipeline #20013 failed with stage
in 16 minutes and 17 seconds
......@@ -86,6 +86,8 @@ if not path_idempotent_file_exists:
params.oper.Lx = lx = lz / nz * nx
params.oper.Ly = ly = lz / nz * ny
params.oper.Lz = lz
params.oper.NO_SHEAR_MODES = True
params.no_vz_kz0 = True
r"""
......
......@@ -47,6 +47,8 @@ params.oper.nz = nz
params.oper.Lx = lx = lz / nz * nx
params.oper.Ly = ly = lz / nz * ny
params.oper.Lz = lz
params.oper.NO_SHEAR_MODES = True
params.no_vz_kz0 = True
r"""
......
......@@ -41,6 +41,8 @@ params.oper.nz = nz
params.oper.Lx = lx = lz / nz * nx
params.oper.Ly = ly = lz / nz * ny
params.oper.Lz = lz
params.oper.NO_SHEAR_MODES = True
params.no_vz_kz0 = True
r"""
......
......@@ -12,8 +12,8 @@ Provides:
from pathlib import Path
from logging import warn
from math import pi
import numpy as np
from scipy import signal
import h5py
......@@ -90,7 +90,6 @@ class SpatioTemporalSpectra(SpecificOutput):
"""
_tag = "spatiotemporal_spectra"
# _name_file = _tag + ".h5"
@staticmethod
def _complete_params_with_default(params):
......
......@@ -45,8 +45,10 @@ def compute_spectrum_kzkhomega(
for ik2 in range(nk2):
values = field_k0k1k2omega[ik0, ik1, ik2, :]
kx = KX[ik0, ik1, ik2]
# TODO: other condition (kx != kx_max)
if kx != 0.0:
# warning: we should also consider another condition
# (kx != kx_max) but it is not necessary here mainly
# because of dealiasing
values = 2 * values
kappa = KH[ik0, ik1, ik2]
......@@ -80,7 +82,7 @@ def compute_spectrum_kzkhomega(
class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra):
def _get_path_saved_spectra(self, tmin, tmax, dtype, save_urud):
base = f"spatiotemporal_spectra_{tmin}_{tmax}"
base = f"periodogram_{tmin}_{tmax}"
if dtype is not None:
base += f"_{dtype}"
if save_urud:
......
import unittest
import sys
from pathlib import Path
from math import pi
import pytest
import numpy as np
import matplotlib.pyplot as plt
......@@ -126,6 +128,7 @@ class TestOutput(TestSimulBase):
)
params.output.spatiotemporal_spectra.SAVE_AS_COMPLEX64 = True
@pytest.mark.filterwarnings("ignore:divide by zero encountered in log10")
def test_output(self):
sim = self.sim
......
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