summaryrefslogtreecommitdiffstats
path: root/info.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-07-12 14:57:41 +0800
committerAaron LI <aaronly.me@outlook.com>2016-07-12 14:57:41 +0800
commitca6b5f0a9e667f07d0f126090fef627ec63b511d (patch)
treea381fc89f1aea61814637cb60e3d312439f8cd87 /info.py
parent5d0fae9fafe8a5ef123c50d7d760fad7af890a7b (diff)
downloadcexcess-ca6b5f0a9e667f07d0f126090fef627ec63b511d.tar.bz2
info.py: add functions "get_name()" and "get_obsid()"
Diffstat (limited to 'info.py')
-rw-r--r--info.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/info.py b/info.py
index 4c50026..1c4454e 100644
--- a/info.py
+++ b/info.py
@@ -1,9 +1,11 @@
#
# Aaron LI
# Created: 2016-05-04
-# Updated: 2016-07-11
+# Updated: 2016-07-12
#
# Change logs:
+# 2016-07-12:
+# * Add functions "get_name()" and "get_obsid()"
# 2016-07-11:
# * Add functions "get_redshift()" and "get_nh()"
# * Add function "get_owner()"
@@ -44,6 +46,29 @@ def get_owner(info):
return "LWT"
+def get_name(info):
+ """
+ Get the source name from the INFO json file.
+ """
+ info = load_info(info)
+ name = info["Source Name"]
+ uname = info.get("Unified Name")
+ results = {
+ "name": name,
+ "uname": uname,
+ }
+ return results
+
+
+def get_obsid(info):
+ """
+ Get the Chandra observation ID from the INFO json file.
+ """
+ info = load_info(info)
+ obsid = int(info["Obs. ID"])
+ return obsid
+
+
def get_r500(info):
"""
Get the R500 value (in unit pixel and kpc), as well as its errors.