summaryrefslogtreecommitdiffstats
path: root/calc_coolfunc.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-07-13 21:07:50 +0800
committerAaron LI <aaronly.me@outlook.com>2016-07-13 21:07:50 +0800
commita432fc8608d499ee589f0216b6bf7e2b7a63de18 (patch)
treeefbbb0d626b954fa9ccebf1f7017aeea5866f281 /calc_coolfunc.py
parent02fd52ee33542cb0589605c30dede707f85801ba (diff)
downloadcexcess-a432fc8608d499ee589f0216b6bf7e2b7a63de18.tar.bz2
Error on missing user config file
Diffstat (limited to 'calc_coolfunc.py')
-rwxr-xr-xcalc_coolfunc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/calc_coolfunc.py b/calc_coolfunc.py
index c21e6b7..cf49afd 100755
--- a/calc_coolfunc.py
+++ b/calc_coolfunc.py
@@ -8,6 +8,7 @@
#
# Change logs:
# 2016-07-13:
+# * Error on missing user config file
# * Add check of the existence of t_profile
# 2016-07-11:
# * Use a default config to allow a minimal user config
@@ -67,16 +68,16 @@ config_default = """
t_profile = t_profile.txt
# average abundance (unit: solar)
-abundance = -1
+abundance = <ABUNDANCE>
# abundance table (default: grsa)
abund_table = grsa
# redshift of the object
-redshift = -1
+redshift = <REDSHIFT>
# H column density (unit: 10^22 cm^-2)
-nh = -1
+nh = <NH>
# energy range within which to calculate the cooling function (unit: keV)
energy_low = 0.7
@@ -186,7 +187,7 @@ def main():
args = parser.parse_args()
config = ConfigObj(config_default.splitlines())
- config_user = ConfigObj(args.config)
+ config_user = ConfigObj(open(args.config))
config.merge(config_user)
if not os.path.exists(config["t_profile"]):