diff options
author | Aaron LI <aly@aaronly.me> | 2018-01-02 14:18:41 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-01-02 14:18:41 +0800 |
commit | 0925da524aa56d4141c3ba9605ba9e2944e4cda8 (patch) | |
tree | 7b6b9403d00e30ef811c3b45cf69f6e46f6f99ec /fg21sim/extragalactic | |
parent | 34098c6a8b1008f4950e8524936406b6611d74f9 (diff) | |
download | fg21sim-0925da524aa56d4141c3ba9605ba9e2944e4cda8.tar.bz2 |
clusters: dump & load catalog with comments
Diffstat (limited to 'fg21sim/extragalactic')
-rw-r--r-- | fg21sim/extragalactic/clusters/main.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index ab5a32e..d18faf0 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -311,7 +311,7 @@ class GalaxyClusters: """ Calculate the radio emissions at configured frequencies. """ - logger.info("Calculating the radio emissions for halos ...") + logger.info("Calculating the radio halo emissions ...") num = len(self.halos) i = 0 for hdict in self.halos: @@ -420,7 +420,8 @@ class GalaxyClusters: outfile = os.path.splitext(outfile)[0] + ".pkl" if self.use_dump_catalog_data and os.path.exists(outfile): os.rename(outfile, outfile+".old") - pickle_dump(self.catalog, outfile=outfile, clobber=clobber) + pickle_dump([self.catalog, self.comments], + outfile=outfile, clobber=clobber) logger.info("Dumped catalog raw data to file: %s" % outfile) def _save_halos_data(self, outfile=None, dump=None, clobber=None): @@ -496,8 +497,7 @@ class GalaxyClusters: if self.use_dump_catalog_data: infile = os.path.splitext(self.catalog_outfile)[0] + ".pkl" logger.info("Use existing cluster catalog: %s" % infile) - self.catalog = pickle_load(infile) - self.comments = [] + self.catalog, self.comments = pickle_load(infile) logger.info("Loaded cluster catalog of %d clusters" % len(self.catalog)) else: @@ -507,7 +507,7 @@ class GalaxyClusters: if self.use_dump_halos_data: infile = os.path.splitext(self.halos_catalog_outfile)[0] + ".pkl" - logger.info("Use existing dumped halos raw data: %s" % infile) + logger.info("Use existing halos data: %s" % infile) self.halos = pickle_load(infile) logger.info("Loaded data of %d halos" % len(self.halos)) else: |