diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-07-11 21:38:38 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-07-11 21:38:38 +0800 |
commit | 48eb038dd4e0b9383315a76fb4b739d1671a1714 (patch) | |
tree | 03173e7cea3758f34658d13fe5c47df7e9a976bf | |
parent | 1f2c58e629ae717fae771335f19a9a76271241eb (diff) | |
download | cexcess-48eb038dd4e0b9383315a76fb4b739d1671a1714.tar.bz2 |
info.py: Add functions "get_redshift()" and "get_nh()"
-rw-r--r-- | info.py | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |