diff --git a/ismfeed/ismfeed.py b/ismfeed/ismfeed.py index 39e9187..b8a06b4 100644 --- a/ismfeed/ismfeed.py +++ b/ismfeed/ismfeed.py @@ -1,6 +1,6 @@ from scipy.integrate import solve_ivp from plotter import U -import select_snapshot +import utils.snapshotselector import numpy as np import pandas as pd diff --git a/plotter.py b/plotter.py index 0b387fd..fb36b11 100644 --- a/plotter.py +++ b/plotter.py @@ -39,7 +39,7 @@ from mpl_toolkits.axes_grid1.inset_locator import inset_axes from baseprocessor import Rule, BaseProcessor from aggregator import Aggregator from studyprocessor import StudyProcessor -from runselector import RunSelector +from utils.runselector import RunSelector from utils.units import U, unit_str, convert_exp try: diff --git a/mngseg.py b/scripts/mngseg.py similarity index 100% rename from mngseg.py rename to scripts/mngseg.py diff --git a/snapshotprocessor.py b/snapshotprocessor.py index 238cfab..cce8fd5 100644 --- a/snapshotprocessor.py +++ b/snapshotprocessor.py @@ -48,7 +48,7 @@ from baseprocessor import ( oct_vect_getter, ) -from runselector import RunSelector +from utils.runselector import RunSelector # Getters @@ -1440,6 +1440,8 @@ class SnapshotProcessor(HDF5Container): pspec.pspec(repo=self.path, iouts=[self.num], outfile=outfile, **kwargs) return np.array([self.pspec_filename]) + + def _write_particles(self): """Ensure particles are written in the hdf5 file""" if not os.path.exists(self.parts_filename) and not self.parts_loaded: diff --git a/studyprocessor.py b/studyprocessor.py index ffa48a5..32c4c0f 100644 --- a/studyprocessor.py +++ b/studyprocessor.py @@ -12,7 +12,7 @@ from scipy.stats import linregress from baseprocessor import Rule, HDF5Container from aggregator import Aggregator from snapshotprocessor import SnapshotProcessor -from runselector import RunSelector +from utils.runselector import RunSelector from utils.params import default_params from utils.units import U diff --git a/turbox/turbox.py b/turbox/turbox.py index fdb8038..67f9526 100644 --- a/turbox/turbox.py +++ b/turbox/turbox.py @@ -29,7 +29,7 @@ def get_pspec(pp, field:str, dim:int=3): Returns ------- tupple (np.array, np.array) - wave number and correponding powers + wave number and corresponding powers """ h5file = tables.File(pp.pspec_filename) path = f"/out_{pp.num:05}/d{dim}/{field}" @@ -48,7 +48,7 @@ span_resolution = { } -def get_slope(pp, field:str, resol:int, plotdebug:bool=False): +def get_pspec_slope(pp, field:str, resol:int, plotdebug:bool=False): """Get the slope of the Power specturm using linear regression in the selected range Parameters @@ -64,8 +64,8 @@ def get_slope(pp, field:str, resol:int, plotdebug:bool=False): tuple (float, float) Slope, square value of the correlation coefficient """ - # Trustworthy span od the power spectrum in log10(k) as a function of the resolution + # Trustworthy span od the power spectrum in log10(k) as a function of the resolution logkmin, logkmax = span_resolution[resol] k, power = get_pspec(pp, field) logk, logpower = np.log10(k), np.log10(power) diff --git a/extract_velcube.py b/utils/extract_velcube.py similarity index 100% rename from extract_velcube.py rename to utils/extract_velcube.py diff --git a/runselector.py b/utils/runselector.py similarity index 100% rename from runselector.py rename to utils/runselector.py diff --git a/select_snapshot.py b/utils/snapshotselector.py similarity index 96% rename from select_snapshot.py rename to utils/snapshotselector.py index d954af3..b808942 100644 --- a/select_snapshot.py +++ b/utils/snapshotselector.py @@ -5,7 +5,7 @@ Select snaphots with a criterion """ -from runselector import RunSelector +from utils.runselector import RunSelector from plotter import Plotter, U import os