summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-07-13 15:27:11 +0800
committerAaron LI <aaronly.me@outlook.com>2016-07-13 15:27:11 +0800
commitbbe0a0cbfae52205601b3d1d858b26d2bfb9e32d (patch)
treeac875b14e2776007d313ce8e968db68a0288ba4e
parent3d52b6e86c69a99c464c335ad4bc90527a4b3379 (diff)
downloadcexcess-bbe0a0cbfae52205601b3d1d858b26d2bfb9e32d.tar.bz2
calc_coolfunc.py: add check the existence of t_profile
-rwxr-xr-xcalc_coolfunc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/calc_coolfunc.py b/calc_coolfunc.py
index 32a7ada..c21e6b7 100755
--- a/calc_coolfunc.py
+++ b/calc_coolfunc.py
@@ -4,9 +4,11 @@
#
# Aaron LI
# Created: 2016-06-19
-# Updated: 2016-07-11
+# Updated: 2016-07-13
#
# Change logs:
+# 2016-07-13:
+# * Add check of the existence of t_profile
# 2016-07-11:
# * Use a default config to allow a minimal user config
# 2016-07-04:
@@ -187,6 +189,9 @@ def main():
config_user = ConfigObj(args.config)
config.merge(config_user)
+ if not os.path.exists(config["t_profile"]):
+ raise FileNotFoundError("file not exists: %s" % config["t_profile"])
+
redshift = config.as_float("redshift")
config_data = {
"prog_name": os.path.basename(sys.argv[0]),