summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-07-11 21:38:38 +0800
committerAaron LI <aaronly.me@outlook.com>2016-07-11 21:38:38 +0800
commit48eb038dd4e0b9383315a76fb4b739d1671a1714 (patch)
tree03173e7cea3758f34658d13fe5c47df7e9a976bf
parent1f2c58e629ae717fae771335f19a9a76271241eb (diff)
downloadcexcess-48eb038dd4e0b9383315a76fb4b739d1671a1714.tar.bz2
info.py: Add functions "get_redshift()" and "get_nh()"
-rw-r--r--info.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/info.py b/info.py
index 70c5b7e..4c50026 100644
--- a/info.py
+++ b/info.py
@@ -5,6 +5,7 @@
#
# Change logs:
# 2016-07-11:
+# * Add functions "get_redshift()" and "get_nh()"
# * Add function "get_owner()"
#
@@ -82,3 +83,24 @@ def get_r500(info):
"kpc_per_pix": kpc_per_pix,
}
return results
+
+
+def get_redshift(info):
+ """
+ Get the redshift from the info json file.
+ """
+ info = load_info(info)
+ redshift = float(info["redshift"])
+ return redshift
+
+
+def get_nh(info):
+ """
+ Get the column density (nH) from the info json file.
+ """
+ info = load_info(info)
+ if get_owner(info) == "LWT":
+ nh = float(info["nH (10^22 cm^-2)"])
+ else:
+ nh = float(info["nH"])
+ return nh