[run_selector] some fixes
This commit is contained in:
+1
-1
@@ -456,7 +456,7 @@ class Plotter(Aggregator, BaseProcessor):
|
|||||||
return r"{} = {}".format(prop_label, prop_value_str)
|
return r"{} = {}".format(prop_label, prop_value_str)
|
||||||
|
|
||||||
def get_label_file(run):
|
def get_label_file(run):
|
||||||
label_filename = f"{self.path}/{run}/{self.pp_params.input.label_filename}"
|
label_filename = f"{self.path}/{run}/{self.params.input.label_filename}"
|
||||||
if os.path.exists(label_filename):
|
if os.path.exists(label_filename):
|
||||||
with open(label_filename, "r") as label_file:
|
with open(label_filename, "r") as label_file:
|
||||||
label = label_file.readline()[:-1]
|
label = label_file.readline()[:-1]
|
||||||
|
|||||||
@@ -258,6 +258,8 @@ class RunSelector:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if in_runs is not None:
|
if in_runs is not None:
|
||||||
|
if isinstance(in_runs, str):
|
||||||
|
in_runs = [in_runs]
|
||||||
runs = list(filter(lambda n: n in runs, in_runs))
|
runs = list(filter(lambda n: n in runs, in_runs))
|
||||||
|
|
||||||
if do_tests:
|
if do_tests:
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ class SnapshotProcessor(HDF5Container):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.info = selector.info[self.run][self.num]
|
self.info = selector.info[self.run][self.num]
|
||||||
self.namelist = selector.namelist[self.run][self.num]
|
self.namelist = selector.namelist[self.run]
|
||||||
self.lbox = self.info["boxlen"]
|
self.lbox = self.info["boxlen"]
|
||||||
|
|
||||||
# Get time
|
# Get time
|
||||||
@@ -1024,7 +1024,7 @@ class SnapshotProcessor(HDF5Container):
|
|||||||
omega = self.get_value("/maps/omega_mwavg_z", unit=U.s ** -1)
|
omega = self.get_value("/maps/omega_mwavg_z", unit=U.s ** -1)
|
||||||
space_coeff = self.info["unit_length"].express(U.m)
|
space_coeff = self.info["unit_length"].express(U.m)
|
||||||
|
|
||||||
map_size = self.pp_params.pymses.map_size
|
map_size = self.params.pymses.map_size
|
||||||
|
|
||||||
if coarsen_factor > 1:
|
if coarsen_factor > 1:
|
||||||
map_size = map_size // coarsen_factor
|
map_size = map_size // coarsen_factor
|
||||||
|
|||||||
+3
-2
@@ -69,6 +69,7 @@ class StudyProcessor(Aggregator, HDF5Container):
|
|||||||
self.snaps[run][num] = SnapshotProcessor(
|
self.snaps[run][num] = SnapshotProcessor(
|
||||||
path_run,
|
path_run,
|
||||||
num,
|
num,
|
||||||
|
selector=selector,
|
||||||
path_out=path_out_run,
|
path_out=path_out_run,
|
||||||
params=self.params,
|
params=self.params,
|
||||||
unit_time=unit_time,
|
unit_time=unit_time,
|
||||||
@@ -669,7 +670,7 @@ class StudyProcessor(Aggregator, HDF5Container):
|
|||||||
"time_rho_prof": Rule(
|
"time_rho_prof": Rule(
|
||||||
self,
|
self,
|
||||||
partial(
|
partial(
|
||||||
self._time_series, partial(self.get_pp_value, "/profile/rho_prof")
|
self._time_series, partial(self.get_snap_value, "/profile/rho_prof")
|
||||||
),
|
),
|
||||||
group="/series",
|
group="/series",
|
||||||
dependencies={"time": None, "rho_prof": "__parent__"},
|
dependencies={"time": None, "rho_prof": "__parent__"},
|
||||||
@@ -677,7 +678,7 @@ class StudyProcessor(Aggregator, HDF5Container):
|
|||||||
"time_coldens_pdf": Rule(
|
"time_coldens_pdf": Rule(
|
||||||
self,
|
self,
|
||||||
partial(
|
partial(
|
||||||
self._time_series, partial(self.get_pp_value, "/hist/pdf_coldens")
|
self._time_series, partial(self.get_snap_value, "/hist/pdf_coldens")
|
||||||
),
|
),
|
||||||
group="/series",
|
group="/series",
|
||||||
dependencies={"time": None, "pdf_coldens": "__parent__"},
|
dependencies={"time": None, "pdf_coldens": "__parent__"},
|
||||||
|
|||||||
Reference in New Issue
Block a user