From 48eb038dd4e0b9383315a76fb4b739d1671a1714 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 11 Jul 2016 21:38:38 +0800 Subject: info.py: Add functions "get_redshift()" and "get_nh()" --- info.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- cgit v1.2.2