diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-07-12 14:57:41 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-07-12 14:57:41 +0800 |
commit | ca6b5f0a9e667f07d0f126090fef627ec63b511d (patch) | |
tree | a381fc89f1aea61814637cb60e3d312439f8cd87 | |
parent | 5d0fae9fafe8a5ef123c50d7d760fad7af890a7b (diff) | |
download | cexcess-ca6b5f0a9e667f07d0f126090fef627ec63b511d.tar.bz2 |
info.py: add functions "get_name()" and "get_obsid()"
-rw-r--r-- | info.py | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -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. |