aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fg21sim/configs/config.spec4
-rw-r--r--fg21sim/extragalactic/clusters/main.py16
2 files changed, 14 insertions, 6 deletions
diff --git a/fg21sim/configs/config.spec b/fg21sim/configs/config.spec
index 5d13bed..e3d0aa5 100644
--- a/fg21sim/configs/config.spec
+++ b/fg21sim/configs/config.spec
@@ -373,6 +373,10 @@ stream = option("stderr", "stdout", "", default="stderr")
# Unit: [keV]
kT_out = float(default=0, min=0)
+ # Whether to make the simulated sky maps? It is useful to disable the
+ # map generation during the parameter tuning.
+ make_maps = boolean(default=True)
+
# Filename prefix for this component
prefix = string(default="cluster")
# Output directory to save the simulated results
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py
index 92a8195..994e0f3 100644
--- a/fg21sim/extragalactic/clusters/main.py
+++ b/fg21sim/extragalactic/clusters/main.py
@@ -85,6 +85,7 @@ class GalaxyClusters:
self.merger_mass_min = configs.getn(sec+"/merger_mass_min")
self.time_traceback = configs.getn(sec+"/time_traceback")
self.kT_out = configs.getn(sec+"/kT_out")
+ self.make_maps = configs.getn(sec+"/make_maps")
self.frequencies = configs.frequencies
self.filename_pattern = configs.getn("output/filename_pattern")
@@ -650,11 +651,15 @@ class GalaxyClusters:
"""
logger.info("Simulating {name} ...".format(name=self.name))
skyfiles = []
- for idx, freq in enumerate(self.frequencies):
- sky = self.simulate_frequency(freqidx=idx)
- outfile = self._outfilepath(frequency=freq)
- sky.write(outfile)
- skyfiles.append(outfile)
+ if self.make_maps:
+ for idx, freq in enumerate(self.frequencies):
+ sky = self.simulate_frequency(freqidx=idx)
+ outfile = self._outfilepath(frequency=freq)
+ sky.write(outfile)
+ skyfiles.append(outfile)
+ else:
+ logger.warning("Map generation disabled!")
+
logger.info("Done simulate {name}!".format(name=self.name))
return skyfiles
@@ -663,7 +668,6 @@ class GalaxyClusters:
Do some necessary post-simulation operations.
"""
logger.info("{name}: postprocessing ...".format(name=self.name))
- # Save the final resulting clusters catalog
logger.info("Save the cluster catalog ...")
self._save_catalog_data()
logger.info("Saving the simulated halos catalog and raw data ...")