diff options
author | Aaron LI <aly@aaronly.me> | 2017-07-21 10:21:10 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-07-21 10:21:10 +0800 |
commit | f252691a199cb1761c3a5f81ee0931212b3c5ac9 (patch) | |
tree | 019cc2d9d852ba4d446a28341250abdd89dd70a0 /bin | |
parent | 7b35db2dc2ebae3ecc97749342ebe5951eb5eaae (diff) | |
download | fg21sim-f252691a199cb1761c3a5f81ee0931212b3c5ac9.tar.bz2 |
bin/fg21sim: Setup cosmology model at the beginning
* Update copyright
* Add a help on "DEBUG_FG21SIM"
* Also fix a bug in cosmology setup()
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fg21sim | 11 |
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) |