aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-02-26 21:24:23 +0800
committerAaron LI <aly@aaronly.me>2019-02-26 21:24:23 +0800
commit12113be5f66bbfb048cc49b47c8df96d44a57807 (patch)
treecde2e1ff4e1070b04b1a8dfa375dfcbb4ff1cfbb /fg21sim/extragalactic
parente405b8dbb8b8bd4c9eda80cb49235979e7500a3f (diff)
downloadfg21sim-12113be5f66bbfb048cc49b47c8df96d44a57807.tar.bz2
clusters/main: Allow to disable map generation
New configuration option 'extragalactic/clusters/make_maps' is added to control whether or not to make and save the simulated maps.
Diffstat (limited to 'fg21sim/extragalactic')
-rw-r--r--fg21sim/extragalactic/clusters/main.py16
1 files changed, 10 insertions, 6 deletions
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 ...")