aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fg21sim11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/fg21sim b/bin/fg21sim
index 0e58551..c25aef3 100755
--- a/bin/fg21sim
+++ b/bin/fg21sim
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- mode: python -*-
#
-# Copyright (c) 2016 Weitian LI <liweitianux@live.com>
+# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me>
# MIT license
"""
@@ -15,12 +15,13 @@ import logging
import time
from fg21sim.configs import configs
-from fg21sim.utils import setup_logging
+from fg21sim.utils import setup_logging, cosmo
def main():
parser = argparse.ArgumentParser(
- description="Simulate the radio foregrounds for 21cm EoR signal")
+ description="Simulate the radio foregrounds for 21cm EoR signal",
+ epilog="Set environment variable 'DEBUG_FG21SIM=1' to force debug!")
parser.add_argument("config", help="user configuration file")
parser.add_argument("-l", "--log", dest="loglevel", default=None,
choices=["DEBUG", "INFO", "WARNING",
@@ -55,6 +56,10 @@ def main():
configs.save(configfile_dump, clobber=True, backup=True)
logger.info("Saved current configurations to file: %s" % configfile_dump)
+ # Setup cosmology model
+ logger.info("Setup cosmology model with parameters from configs ...")
+ cosmo.setup(**configs.cosmology)
+
logger.info("Importing modules + Numba JIT, waiting ...")
from fg21sim.foregrounds import Foregrounds
fg = Foregrounds(configs)