aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/galactic/freefree.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-17 18:21:13 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-17 18:21:13 +0800
commit3fb0539004b621631ebdb02f538b2060d31b79f9 (patch)
treec243b24584225f188d883ccbc3bf297983ba73a5 /fg21sim/galactic/freefree.py
parentd00427046e3a50148a0f40ad41ab550b62431965 (diff)
downloadfg21sim-3fb0539004b621631ebdb02f538b2060d31b79f9.tar.bz2
galactic: Move the "simulate()" method; Add "UNIT" keyword
Diffstat (limited to 'fg21sim/galactic/freefree.py')
-rw-r--r--fg21sim/galactic/freefree.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/fg21sim/galactic/freefree.py b/fg21sim/galactic/freefree.py
index 352621b..c20f0c1 100644
--- a/fg21sim/galactic/freefree.py
+++ b/fg21sim/galactic/freefree.py
@@ -198,6 +198,18 @@ class FreeFree:
hpmap_f = self.halphamap * ratio_K_R
return hpmap_f
+ def simulate(self, frequencies):
+ """Simulate the free-free map at the specified frequencies."""
+ hpmaps = []
+ for f in np.array(frequencies, ndmin=1):
+ logger.info("Simulating free-free map at {0} ({1}) ...".format(
+ f, self.freq_unit))
+ hpmap_f = self._simulate_frequency(f)
+ hpmaps.append(hpmap_f)
+ if self.save:
+ self.output(hpmap_f, f)
+ return hpmaps
+
def _make_header(self):
"""Make the header with detail information (e.g., parameters and
history) for the simulated products.
@@ -205,6 +217,7 @@ class FreeFree:
header = fits.Header()
header["COMP"] = ("Galactic free-free emission",
"Emission component")
+ header["UNIT"] = ("Kelvin", "Map unit")
header["CREATOR"] = (__name__, "File creator")
# TODO:
history = []
@@ -241,15 +254,3 @@ class FreeFree:
write_fits_healpix(filepath, hpmap, header=header,
clobber=self.clobber)
logger.info("Write simulated map to file: {0}".format(filepath))
-
- def simulate(self, frequencies):
- """Simulate the free-free map at the specified frequencies."""
- hpmaps = []
- for f in np.array(frequencies, ndmin=1):
- logger.info("Simulating free-free map at {0} ({1}) ...".format(
- f, self.freq_unit))
- hpmap_f = self._simulate_frequency(f)
- hpmaps.append(hpmap_f)
- if self.save:
- self.output(hpmap_f, f)
- return hpmaps