[plotter] change kind name. For kind=comp, do only one plot ;)

This commit is contained in:
Noe Brucy
2021-01-31 17:25:28 +01:00
parent 8befb9ba37
commit 7aa08c1394
2 changed files with 17 additions and 16 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ class Rule:
description="",
group="",
dependencies=[],
kind="classic",
kind="snapshot",
unit=U.none,
):
self.postproc = postproc
+16 -15
View File
@@ -299,8 +299,10 @@ class Plotter(Aggregator, BaseProcessor):
datafiles = []
# Several plots
if rule.kind == "classic" or rule.kind == "cells":
if rule.kind == "snapshot" or rule.kind == "cells":
run_num = [(run, num) for run in runs for num in nums[run]]
elif rule.kind == "comp":
run_num = [(None, None)]
else:
run_num = [(run, None) for run in runs]
@@ -325,7 +327,7 @@ class Plotter(Aggregator, BaseProcessor):
self.pp[run][num].load_cells()
self.pp[run][num].unload_cells()
save = tables.open_file(self.pp[run][num].cells_filename)
elif rule.kind == "classic":
elif rule.kind == "snapshot":
save = tables.open_file(self.pp[run][num].filename)
else:
save = tables.open_file(self.comp.filename, "r")
@@ -1219,7 +1221,7 @@ class Plotter(Aggregator, BaseProcessor):
"/series/" + logrule + "/" + name_y,
),
description=description,
kind="series",
kind="run",
dependencies=[logrule],
)
@@ -1228,7 +1230,6 @@ class Plotter(Aggregator, BaseProcessor):
This is where rules are defined
"""
self.rules = {
# Generic rules
"plot": PlotRule(
self, lambda arg, **kwargs: self._plot(*arg, **kwargs), kind="comp"
),
@@ -1490,7 +1491,7 @@ class Plotter(Aggregator, BaseProcessor):
yunit=U.Msun,
),
"Mass of the sinks as a function of time",
kind="series",
kind="run",
dependencies=["sinks_from_log"],
),
"ssm": PlotRule(
@@ -1503,7 +1504,7 @@ class Plotter(Aggregator, BaseProcessor):
yunit=U.Msun / U.pc ** 2,
),
"Mass of the sinks as a function of time divided by surface",
kind="series",
kind="run",
dependencies=["ssm"],
),
"assfr": PlotRule(
@@ -1516,7 +1517,7 @@ class Plotter(Aggregator, BaseProcessor):
xunit=U.Myr,
yunit=U.ssfr,
),
kind="series",
kind="run",
dependencies=["sfr_from_log"],
),
"issfr": PlotRule(
@@ -1529,7 +1530,7 @@ class Plotter(Aggregator, BaseProcessor):
xunit=U.Myr,
yunit=U.ssfr,
),
kind="series",
kind="run",
dependencies=["issfr"],
),
"turb_rms": PlotRule(
@@ -1541,7 +1542,7 @@ class Plotter(Aggregator, BaseProcessor):
xunit=U.Myr,
),
"Turbulent RMS",
kind="series",
kind="run",
dependencies=["rms_from_log"],
),
"turb_energy": PlotRule(
@@ -1553,7 +1554,7 @@ class Plotter(Aggregator, BaseProcessor):
xunit=U.Myr,
),
"Turbulent energy",
kind="series",
kind="run",
dependencies=["rms_from_log"],
),
"turb_power": PlotRule(
@@ -1565,7 +1566,7 @@ class Plotter(Aggregator, BaseProcessor):
xunit=U.Myr,
),
"Turbulent power",
kind="series",
kind="run",
dependencies=["turb_power"],
),
"sigma": PlotRule(
@@ -1579,7 +1580,7 @@ class Plotter(Aggregator, BaseProcessor):
yunit=U.km_s,
),
"Velocity dispersion",
kind="series",
kind="run",
dependencies=["time_sigma"],
),
"mwa_B_int": PlotRule(
@@ -1592,7 +1593,7 @@ class Plotter(Aggregator, BaseProcessor):
yunit=U.uG,
),
"Magnetic intensity average",
kind="series",
kind="run",
dependencies=["time_mwa_B_int"],
),
"mass": PlotRule(
@@ -1605,7 +1606,7 @@ class Plotter(Aggregator, BaseProcessor):
yunit=U.Msun,
),
"Total mass in the box",
kind="series",
kind="run",
dependencies=["time_mass"],
),
"max_fluct_coldens": PlotRule(
@@ -1618,7 +1619,7 @@ class Plotter(Aggregator, BaseProcessor):
xunit=U.Myr,
),
"Maximal fluctuation of the column density against time",
kind="series",
kind="run",
dependencies={"time_max_fluct_coldens": "z"},
),
}