summaryrefslogtreecommitdiffstats
path: root/astro_params.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-06-24 10:25:10 +0800
committerAaron LI <aaronly.me@outlook.com>2016-06-24 10:25:10 +0800
commit141db57c21903b2130803a1a738b55ac77aabf81 (patch)
treecd25a2ad96833eadcf006607c9b63ba68bc34de0 /astro_params.py
parent4f7eee8b1cbe552e6bebeabe5209d88f654321f5 (diff)
downloadcexcess-141db57c21903b2130803a1a738b55ac77aabf81.tar.bz2
deproject_sbp.py: split "AstroParams" to module "astro_params.py"
Diffstat (limited to 'astro_params.py')
-rw-r--r--astro_params.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/astro_params.py b/astro_params.py
new file mode 100644
index 0000000..a272ba4
--- /dev/null
+++ b/astro_params.py
@@ -0,0 +1,33 @@
+# -*- mode: python -*-
+#
+# Weitian LI
+# Created: 2016-06-24
+# Updated: 2016-06-24
+#
+
+"""
+This module contains the parameters/constants used in astronomy
+and astrophysics.
+"""
+
+import astropy.units as au
+
+
+class AstroParams:
+ """
+ The parameters/constants used in astronomy.
+
+ References:
+ [1] ref. [4], eq.(9) below
+ """
+ # Hubble constant at z=0
+ H0 = 71.0 # [ km/s/Mpc ]
+ # density of non-relativistic matter in units of the critical density
+ # at z=0
+ OmegaM0 = 0.27
+ # ratio of electron density (n_e) to proton density (n_p) [1]
+ ratio_ne_np = 1.211
+ # molecular weight per electron (0.3 solar abundance; grsa table) [1]
+ mu_e = 1.155
+ # atomic mass unit
+ m_atom = au.u.to(au.g) # [ g ]