aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fg21sim
diff options
context:
space:
mode:
Diffstat (limited to 'bin/fg21sim')
-rwxr-xr-xbin/fg21sim28
1 files changed, 24 insertions, 4 deletions
diff --git a/bin/fg21sim b/bin/fg21sim
index 8098ac3..2b087a7 100755
--- a/bin/fg21sim
+++ b/bin/fg21sim
@@ -18,6 +18,7 @@ import numpy as np
from fg21sim.configs import configs, validate_configs
from fg21sim.utils import setup_logging
from fg21sim.galactic import Synchrotron as GalacticSynchrotron
+from fg21sim.galactic import FreeFree as GalacticFreeFree
def main():
@@ -57,10 +58,29 @@ def main():
min=frequencies.min(), max=frequencies.max(),
num=len(frequencies), unit=freq_unit))
- logger.info("Simulating the Galactic synchrotron foreground ...")
- gsynchrotron = GalacticSynchrotron(configs)
- map_gsync = gsynchrotron.simulate(frequencies)
- logger.info("Done simulate Galactic synchrotron foreground!")
+ # XXX/TODO: move the supported components and id's to a module/file
+ fg_components = configs.getn("common/components")
+ logger.info("Enabled simulation components: {0}".format(
+ ", ".join(fg_components)))
+ fg_maps = {}
+
+ # Galactic synchrotron
+ id_gsync = "galactic/synchrotron"
+ if id_gsync in fg_components:
+ logger.info("Simulating the Galactic synchrotron foreground ...")
+ gsynchrotron = GalacticSynchrotron(configs)
+ hpmap_gsync = gsynchrotron.simulate(frequencies)
+ logger.info("Done simulate Galactic synchrotron foreground!")
+ fg_maps[id_gsync] = hpmap_gsync
+
+ # Galactic free-free
+ id_gfree = "galactic/freefree"
+ if id_gfree in fg_components:
+ logger.info("Simulating the Galactic free-free foreground ...")
+ gfreefree = GalacticFreeFree(configs)
+ hpmap_gfree = gfreefree.simulate(frequencies)
+ logger.info("Done simulate Galactic free-free foreground!")
+ fg_maps[id_gfree] = hpmap_gfree
if __name__ == "__main__":