aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-01-20 00:10:03 +0800
committerAaron LI <aly@aaronly.me>2018-01-20 00:10:03 +0800
commitcecc2288b47699ad101142c73d959a719667dd0c (patch)
treee63f204373ccf24cd0d038a092cf97f9767eb973 /bin/fg21sim
parent98f85ee94baaec79747c059cf86c92130459530a (diff)
downloadfg21sim-cecc2288b47699ad101142c73d959a719667dd0c.tar.bz2
bin/fg21sim: add --version argument, and log version information
Diffstat (limited to 'bin/fg21sim')
-rwxr-xr-xbin/fg21sim6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/fg21sim b/bin/fg21sim
index cce91dc..052c50e 100755
--- a/bin/fg21sim
+++ b/bin/fg21sim
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- mode: python -*-
#
-# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me>
+# Copyright (c) 2016-2018 Weitian LI <weitian@aaronly.me>
# MIT license
"""
@@ -14,6 +14,7 @@ import argparse
import logging
import time
+import fg21sim
from fg21sim.share import CONFIGS, COSMO
from fg21sim.utils import setup_logging
@@ -23,6 +24,8 @@ def main():
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("-v", "--version", action="version",
+ version="%(prog)s: version "+fg21sim.__version__)
parser.add_argument("-l", "--log", dest="loglevel", default=None,
choices=["debug", "info", "warning",
"error", "critical"],
@@ -49,6 +52,7 @@ def main():
logfile=args.logfile)
tool = os.path.basename(sys.argv[0])
logger = logging.getLogger(tool)
+ logger.info("FG21sim: version %s" % fg21sim.__version__)
logger.info("COMMAND: {0}".format(" ".join(sys.argv)))
# Save/backup current configurations