summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.