diff options
author | Aaron LI <aly@aaronly.me> | 2017-08-01 00:59:38 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-08-01 00:59:38 +0800 |
commit | 9adf1e91d0819f84b1327f6d38cf20c4389430cd (patch) | |
tree | 553e513405b4f53cce827dbd8577b91ac06a8688 /fg21sim/extragalactic | |
parent | adc667c206b8c3438be8a94f3a839edc3a077ce0 (diff) | |
download | fg21sim-9adf1e91d0819f84b1327f6d38cf20c4389430cd.tar.bz2 |
clusters: Add config "halos_dumpfile" and dump simulate halos data
Diffstat (limited to 'fg21sim/extragalactic')
-rw-r--r-- | fg21sim/extragalactic/clusters/main.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index 10f169c..43c4c09 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -26,7 +26,7 @@ from .psformalism import PSFormalism from .formation import ClusterFormation from .halo import RadioHalo from ...share import CONFIGS, COSMO -from ...utils.io import dataframe_to_csv +from ...utils.io import dataframe_to_csv, pickle_dump from ...sky import get_sky @@ -69,6 +69,7 @@ class GalaxyClusters: """ comp = "extragalactic/clusters" self.catalog_outfile = self.configs.get_path(comp+"/catalog_outfile") + self.halos_dumpfile = self.configs.get_path(comp+"/halos_dumpfile") self.prefix = self.configs.getn(comp+"/prefix") self.save = self.configs.getn(comp+"/save") self.output_dir = self.configs.get_path(comp+"/output_dir") @@ -300,3 +301,9 @@ class GalaxyClusters: dataframe_to_csv(self.catalog, outfile=self.catalog_outfile, comment=self.catalog_comment, clobber=self.clobber) + # Dump the simulated clusters data + if self.halos_dumpfile is None: + logger.warning("Missing dump outfile; skip dump cluster data!") + else: + pickle_dump(self.halos, outfile=self.halos_dumpfile, + clobber=self.clobber) |