aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-08-15 10:22:08 +0800
committerAaron LI <aly@aaronly.me>2017-08-15 10:22:08 +0800
commit1d8280961cf95887dc532da56ea595e097889b38 (patch)
tree0791227b82c992f77de70cbcfd83b22d867f0914
parent75752577aea888de365e53982e3a101f35d01b56 (diff)
downloadchandra-acis-analysis-1d8280961cf95887dc532da56ea595e097889b38.tar.bz2
cosmo_calc.py: Use variables H0, Om0, pixelsize
TODO: add argument --pixelsize with default value of 0.492 [arcsec]
-rwxr-xr-xbin/cosmo_calc.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/bin/cosmo_calc.py b/bin/cosmo_calc.py
index 1302bdb..3f0b81f 100755
--- a/bin/cosmo_calc.py
+++ b/bin/cosmo_calc.py
@@ -74,15 +74,22 @@ def calc_quantity(q, calculator, args):
def main():
+ # Hubble parameter at present day
+ H0 = 71.0 # [km/s/Mpc]
+ # Present-day matter density
+ Om0 = 0.27
+ # Chandra ACIS pixel size
+ pixelsize = 0.492 # [arcsec]
+
parser = argparse.ArgumentParser(
description="Cosmology calculator with Chandra-specific quantities")
parser.add_argument("-H", "--hubble", dest="H0",
- type=float, default=71.0,
+ type=float, default=H0,
help="Present-day Hubble parameter " +
- "(default: 71 km/s/Mpc)")
+ "(default: %s [km/s/Mpc])" % H0)
parser.add_argument("-M", "--omega-m", dest="Om0",
- type=float, default=0.27,
- help="Present-day matter density (default: 0.27")
+ type=float, default=Om0,
+ help="Present-day matter density (default: %s)" % Om0)
parser.add_argument("-b", "--brief", dest="brief", action="store_true",
help="be brief")
parser.add_argument("-U", "--unit", dest="unit",
@@ -102,11 +109,11 @@ def main():
parser.add_argument("--kpc-per-pix", dest="kpc_per_pix",
action="store_true",
help="calculate the transversal length [kpc] " +
- "w.r.t. 1 ACIS pixel (0.492 arcsec) at DA(z)")
+ "w.r.t. 1 pixel (%s [arcsec]) at DA(z)" % pixelsize)
parser.add_argument("--cm-per-pix", dest="cm_per_pix",
action="store_true",
help="calculate the transversal length [cm] " +
- "w.r.t. 1 ACIS pixel (0.492 arcsec) at DA(z)")
+ "w.r.t. 1 pixel (%s [arcsec]) at DA(z)" % pixelsize)
parser.add_argument("--norm-apec", dest="norm_apec",
action="store_true",
help="calculate the normalization factor " +