aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/galactic/freefree.py
diff options
context:
space:
mode:
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