diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-11-21 10:55:34 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-11-21 10:55:34 +0800 |
commit | d5ca15269ebfa6da1c4b8a7651eb06e403b6abdd (patch) | |
tree | 294921668bdac3bbbb9614d8aee964accae28edb /fg21sim/foregrounds.py | |
parent | 1d8584da1d62b605349a198182d0d720049403b1 (diff) | |
download | fg21sim-d5ca15269ebfa6da1c4b8a7651eb06e403b6abdd.tar.bz2 |
Fix two bugs and change one variable name
* foregrounds.py: Use "configs.get_path()" to get the manifest file path;
* foregrounds.py: Use "min()" and "max()" since "self.frequencies" has
been changed to be a plain Python list instead of a Numpy array;
* foregrounds.py: Change the variable "freqid" to "freq_id";
* products.py: Assign the attribute "self.manifestfile"
Diffstat (limited to 'fg21sim/foregrounds.py')
-rw-r--r-- | fg21sim/foregrounds.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fg21sim/foregrounds.py b/fg21sim/foregrounds.py index 13749f1..e004a52 100644 --- a/fg21sim/foregrounds.py +++ b/fg21sim/foregrounds.py @@ -79,7 +79,7 @@ class Foregrounds: self._set_configs() # Initialize the products manifest logger.info("Initialize the products manifest ...") - manifestfile = self.configs.getn("output/manifest") + manifestfile = self.configs.get_path("output/manifest") self.products = Products(manifestfile) # Initialize enabled components self.components = OrderedDict() @@ -101,8 +101,8 @@ class Foregrounds: self.freq_unit = au.Unit(self.configs.getn("frequency/unit")) logger.info("Simulation frequencies: " "{min:.2f} - {max:.2f} {unit} (#{num:d})".format( - min=self.frequencies.min(), - max=self.frequencies.max(), + min=min(self.frequencies), + max=max(self.frequencies), num=len(self.frequencies), unit=self.freq_unit)) # @@ -202,8 +202,8 @@ class Foregrounds: """ npix = hp.nside2npix(self.nside) nfreq = len(self.frequencies) - for freqid, freq in enumerate(self.frequencies): - logger.info("[#{0}/{1}] ".format(freqid+1, nfreq) + + for freq_id, freq in enumerate(self.frequencies): + logger.info("[#{0}/{1}] ".format(freq_id+1, nfreq) + "Simulating components at {freq} {unit} ...".format( freq=freq, unit=self.freq_unit)) if self.combine: @@ -211,12 +211,12 @@ class Foregrounds: for comp_id, comp_obj in self.components.items(): hpmap, filepath = comp_obj.simulate_frequency(freq) if filepath is not None: - self.products.add_product(comp_id, freqid, filepath) + self.products.add_product(comp_id, freq_id, filepath) if self.combine: hpmap_comb += hpmap if self.combine: filepath_comb = self._output(hpmap_comb, freq) - self.products.add_product("combined", freqid, filepath_comb) + self.products.add_product("combined", freq_id, filepath_comb) def postprocess(self): """Perform the post-simulation operations before the end.""" |