aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/galactic/synchrotron.py
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim/galactic/synchrotron.py')
-rw-r--r--fg21sim/galactic/synchrotron.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/fg21sim/galactic/synchrotron.py b/fg21sim/galactic/synchrotron.py
index f2de2ce..2d1a59f 100644
--- a/fg21sim/galactic/synchrotron.py
+++ b/fg21sim/galactic/synchrotron.py
@@ -191,14 +191,13 @@ class Synchrotron:
sky = self.sky.copy()
sky.frequency = frequency
ff = frequency / self.template_freq
- data = self.template * ff ** (-np.abs(self.indexmap))
- sky.data = data
+ sky.data = self.template * ff ** (-np.abs(self.indexmap))
logger.info("Done simulate map at %.2f [MHz]." % frequency)
return sky
def simulate(self, frequencies=None):
"""
- Simulate the synchrotron map at the specified frequencies.
+ Simulate the synchrotron maps.
Parameters
----------
@@ -206,6 +205,11 @@ class Synchrotron:
The frequencies where to simulate the foreground map.
Unit: [MHz]
Default: None (i.e., use ``self.frequencies``)
+
+ Returns
+ -------
+ skyfiles : list[str]
+ List of the filepath to the written sky files
"""
if frequencies is None:
frequencies = self.frequencies
@@ -213,11 +217,14 @@ class Synchrotron:
frequencies = np.array(frequencies, ndmin=1)
logger.info("Simulating {name} ...".format(name=self.name))
+ skyfiles = []
for freq in frequencies:
sky = self.simulate_frequency(freq)
outfile = self._outfilepath(frequency=freq)
sky.write(outfile)
+ skyfiles.append(outfile)
logger.info("Done simulate {name}!".format(name=self.name))
+ return skyfiles
def postprocess(self):
"""Perform the post-simulation operations before the end."""