1 """Various constants used by CosmoloPy code.
2
3 Unit abreviations are appended to the name, but powers are not
4 specified. For instance, the gravitational constant has units "Mpc^3
5 msun^-1 s^-2", but is called "G_const_Mpc_Msun_s".
6
7 Most of these numbers are from google calculator.
8
9 Constants are:
10
11 ::
12
13 """
14
15
16
17 doc = ""
18
19 doc += " pc_cm: Parsec in cm\n"
20 pc_cm = 3.08568025e18
21
22 doc += " Mpc_cm: Megaparsec in cm\n"
23 Mpc_cm = 3.08568025e24
24
25 doc += " Mpc_km: Megaparsec in km\n"
26 Mpc_km = Mpc_cm * 1.0e-5
27
28 doc += " angstrom_cm: Angstrom in cm\n"
29 angstrom_cm = 1e-8
30
31 doc += " yr_s: a year in s\n"
32 yr_s = 365. * 24. * 60. * 60.
33
34 doc += " Myr_s: Megayear in s\n"
35 Myr_s = 1.e6 * yr_s
36
37 doc += " Gyr_s: Gigayear in s\n"
38 Gyr_s = 1.e9 * yr_s
39
40 doc += " amu_g: atomic mass unit in g\n"
41 amu_g = 1.66053886e-24
42
43 doc += " m_p_g: mass of a proton in g\n"
44 m_p_g = 1.67262158e-24
45
46 doc += " m_H_g: mass of a hydrogen atom in g\n"
47 m_H_g = 1.00794 * amu_g
48
49 doc += " m_He_g: mass of a helium atom in g\n"
50 m_He_g = 4.002602 * amu_g
51
52 doc += " M_sun_g: Solar mass in grams.\n"
53 M_sun_g = 1.98892e33
54
55 doc += " c_light_cm_s: Speed of light in Mpc/s (from google calculator)\n"
56 c_light_cm_s = 29979245800.
57
58 doc += " c_light_Mpc_s: Speed of light in Mpc/s\n"
59 c_light_Mpc_s = c_light_cm_s / Mpc_cm
60
61 doc += " c_light_Mpc_Gyr: Speed of light in Mpc/Gyr \n"
62 c_light_Mpc_Gyr = Gyr_s * c_light_cm_s / Mpc_cm
63
64 doc += " H100_s: 100 km s^-1 Mpc^-1 in s^-1\n"
65 H100_s = 100. / Mpc_km
66
67 doc += " G_const_Mpc_Msun_s: Gravitational constant in Mpc^3 msun^-1 s^-2\n"
68 G_const_Mpc_Msun_s = M_sun_g * (6.673e-8) / Mpc_cm**3.
69
70 doc += " lambda_Lya_0: Central wavelength of H Lyman-alpha in Angstroms\n"
71 lambda_Lya_0 = 1215.67
72
73 doc += " lambda_NY_0: Central wavelength of an NV doublet in Angstroms\n"
74 lambda_NV_0 = 1240.81
75
76 doc += " alpha_B_cm_s_1e4: hydrogen recombination coefficient at T=10^4 K\n"
77 alpha_B_cm_s_1e4 = 2.59e-13
78
79 doc += " sigma_T_cm: Thomson cross section in cm^2\n"
80 sigma_T_cm = 6.6524586e-25
81
82 doc += " sigma_T_cm: Thomson cross section in Mpc^2\n"
83 sigma_T_Mpc = sigma_T_cm / (Mpc_cm ** 2.)
84
85 __doc__ += "\n".join(sorted(doc.split("\n")))
86