aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-19 10:24:04 +0800
committerAaron LI <aly@aaronly.me>2017-10-19 10:24:04 +0800
commitad293e34d1ae1bf8d8d652ee89464e9b52825b95 (patch)
tree948cdfadf4bcc28e883ffb08a4cb1715da06413f /fg21sim/extragalactic
parente8d45dd2e8365171a9bc6b7cd7c7d6623fa5e013 (diff)
downloadfg21sim-ad293e34d1ae1bf8d8d652ee89464e9b52825b95.tar.bz2
clusters/halo: Add and use attribute "self.halos_data_dumpfile"
Diffstat (limited to 'fg21sim/extragalactic')
-rw-r--r--fg21sim/extragalactic/clusters/main.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py
index 0c3483d..1368408 100644
--- a/fg21sim/extragalactic/clusters/main.py
+++ b/fg21sim/extragalactic/clusters/main.py
@@ -78,6 +78,8 @@ class GalaxyClusters:
self.use_output_catalog = self.configs.getn(comp+"/use_output_catalog")
self.halos_catalog_outfile = self.configs.get_path(
comp+"/halos_catalog_outfile")
+ self.halos_data_dumpfile = os.path.splitext(
+ self.halos_catalog_outfile)[0] + ".pkl"
self.dump_halos_data = self.configs.getn(comp+"/dump_halos_data")
self.prefix = self.configs.getn(comp+"/prefix")
self.output_dir = self.configs.get_path(comp+"/output_dir")
@@ -308,7 +310,7 @@ class GalaxyClusters:
the emissions at additional frequencies.
"""
if outfile is None:
- outfile = os.path.splitext(self.halos_catalog_outfile)[0] + ".pkl"
+ outfile = self.halos_data_dumpfile
pickle_dump(self.halos, outfile=outfile, clobber=self.clobber)
def _draw_halos(self):
@@ -466,7 +468,7 @@ class GalaxyClusters:
os.rename(filepath, filepath+".old")
logger.warning("Backed up halos catalog: %s -> %s" %
(filepath, filepath+".old"))
- filepath = os.path.splitext(self.halos_catalog_outfile)[0]+".pkl"
+ filepath = self.halos_data_dumpfile
os.rename(filepath, filepath+".old")
logger.warning("Backed up halos data dump file: %s -> %s" %
(filepath, filepath+".old"))