aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-22 23:53:20 +0800
committerAaron LI <aly@aaronly.me>2017-07-22 23:53:20 +0800
commit4476a0ca0e22d6a35bb07da87956d21ec7c49074 (patch)
tree8bbbc491e34956c77d8a1b2f3e38c868fd4e3677 /bin/fg21sim
parentfd5ae04bce31a4cb82dea8532028b6df92b3d476 (diff)
downloadfg21sim-4476a0ca0e22d6a35bb07da87956d21ec7c49074.tar.bz2
Use all uppercase to identify the global CONFIGS and COSMO
Update to use the global CONFIGS and COSMO Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'bin/fg21sim')
-rwxr-xr-xbin/fg21sim20
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/fg21sim b/bin/fg21sim
index c25aef3..c80e5ca 100755
--- a/bin/fg21sim
+++ b/bin/fg21sim
@@ -14,8 +14,8 @@ import argparse
import logging
import time
-from fg21sim.configs import configs
-from fg21sim.utils import setup_logging, cosmo
+from fg21sim.configs import CONFIGS
+from fg21sim.utils import setup_logging, COSMO
def main():
@@ -36,14 +36,14 @@ def main():
t1_start = time.perf_counter()
t2_start = time.process_time()
- configs.read_userconfig(args.config)
+ CONFIGS.read_userconfig(args.config)
if os.environ.get("DEBUG_FG21SIM"):
- print("DEBUG: Current configurations:", configs._config,
+ print("DEBUG: Current configurations:", CONFIGS._config,
sep="\n", file=sys.stderr)
- configs.check_all()
+ CONFIGS.check_all()
log_stream = "" if args.quiet else None
- setup_logging(dict_config=configs.logging,
+ setup_logging(dict_config=CONFIGS.logging,
level=args.loglevel,
stream=log_stream,
logfile=args.logfile)
@@ -52,17 +52,17 @@ def main():
logger.info("COMMAND: {0}".format(" ".join(sys.argv)))
# Save/backup current configurations
- configfile_dump = os.path.splitext(configs.userconfig)[0] + "_dump.conf"
- configs.save(configfile_dump, clobber=True, backup=True)
+ configfile_dump = os.path.splitext(CONFIGS.userconfig)[0] + "_dump.conf"
+ 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)
+ COSMO.setup(**CONFIGS.cosmology)
logger.info("Importing modules + Numba JIT, waiting ...")
from fg21sim.foregrounds import Foregrounds
- fg = Foregrounds(configs)
+ fg = Foregrounds(CONFIGS)
fg.preprocess()
fg.simulate()
fg.postprocess()