Package ivs :: Package units :: Module constants
[hide private]
[frames] | no frames]

Source Code for Module ivs.units.constants

  1  # -*- coding: utf-8 -*- 
  2  """ 
  3  List of physical constants (SI, CGS and solar) 
  4   
  5  Many constants are taken from NIST (http://physics.nist.gov/cuu/Constants/index.html) 
  6   
  7  Others have their explicit reference listed. 
  8   
  9  See also L{ivs.units.conversions} for advanced options, such as change the base 
 10  units are changing the values of the fundamental constants to conventions used 
 11  by other programs. 
 12   
 13  Their are two ways one can use the modules in this module: 
 14   
 15      1. Just use the raw SI values in your script (e.g. C{constants.Msol}. For 
 16      convenience, also the cgs values of most constants are given, and 
 17      accessbile via adding the postfix C{'_cgs'}, e.g. C{constants.Msol_cgs}. 
 18      2. If you B{always} want to use cgs values and thus want the default values 
 19      to be cgs without bothering with the postfixes, you can change the values of 
 20      the constants to meet a particular convention via 
 21      L{conversions.set_convention}. After calling 
 22      C{conversions.set_convention('cgs')}, the value of C{constants.Msol} will be 
 23      given in grams instead of kilograms. 
 24   
 25  The safest way of getting the units of the constants exactly as you want them to 
 26  be in a script, is via explicitly converting them to the right convention, e.g. 
 27   
 28  >>> Msol = conversions.convert(constants.Msol_units,'g',constants.Msol) 
 29   
 30  This is independent of the way the conventions are set. 
 31  """ 
 32  _current_convention = 'SI' 
 33  _current_values = 'standard' 
 34  _current_frequency = 'rad' 
 35  # SI-units 
 36  # value                    name                          unit          reference 
 37  #=============================================================================== 
 38  cc     = 299792458.        # speed of light              m/s 
 39  cc_air = cc/1.0002773      # speed of light in air       m/s           T=15C, standard atmospheric pressure 
 40  Msol   = 1.988547e30       # solar mass                  kg            Harmanec & Prsa 2011 
 41  Rsol   = 6.95508e8         # solar radius                m             Harmanec & Prsa 2011 
 42  Lsol   = 3.846e26          # solar luminosity            W             Harmanec & Prsa 2011 
 43  Tsol   = 5779.5747         # solar effective temperature K             Harmanec & Prsa 2011 
 44  agesol = 1.44221e+17       # solar age                   s             Bahcall 2005 
 45  Mearth = 5.9742e24         # earth mass                  kg            google 
 46  Rearth = 6371.e3            # earth radius                m             wikipedia 
 47  Mjup   = 1.8986e27         # Jupiter mass                kg            wikipedia 
 48  Rjup   = 6.9911e7          # Jupiter radius              m             mesa 
 49  Mlun   = 7.346e22          # Lunar mass                  kg            wikipedia 
 50  au     = 149597870700.     # astronomical unit           m             Harmanec & Prsa 2011 
 51  pc     = 3.085677581503e+16# parsec                      m             Harmanec & Prsa 2011 
 52  ly     = 9.460730472580800e+15     # light year                  m 
 53  hh     = 6.6260689633e-34  # Planck constant             J s 
 54  hhbar  = 1.05457162853e-34 # reduced Planck constant     J s 
 55  kB     = 1.380650424e-23   # Boltzmann constant          J/K 
 56  NA     = 6.0221417930e23   # Avogadro constant           1/mol 
 57  sigma  = 5.67040040e-8     # Stefan-Boltzmann constant   W/m2/K4       Harmanec & Prsa 2011 
 58  GG     = 6.67384e-11       # gravitational constant      m3/kg/s2      Harmanec & Prsa 2011 
 59  GGMsol = 1.32712442099e20  # grav. constant x solar mass m3/s2         Harmanec & Prsa 2011 
 60  RR     = 8.31447215        # (ideal) gas constant        J/K/mol 
 61  aa     = 7.5657e-16        # radiation constant          J/m3/K4 
 62  a0     = 52.9177e-12       # Bohr radius of hydrogen     m 
 63  ke     = 8.9875517873681764e9 # Coulomb constant         Nm2/C2        Wikipedia 
 64  eps0   = 8.854187817620e-12   # Electric constant           F/m           Wikipedia 
 65  mu0    = 1.2566370614e-6   # Magnetic constant           N/A2          Wikipedia 
 66  alpha  = 137.036           # Fine structure constant     none           http://pntpm3.ulb.ac.be/private/divers.htm#constants 
 67  me     = 9.1093829140e-31  # Electron mass               kg            Wikipedia 
 68  qe     =-1.60217656535e-19 # Electron charge            C             Wikipedia 
 69  mp     = 1.67262177774e-27 # Proton mass                 kg            Wikipedia 
 70  qp     = 1.60217656535e-19 # Proton charge               C             Wikipedia 
 71   
 72  cc_units     = 'm s-1' 
 73  cc_air_units = 'm s-1' 
 74  Msol_units   = 'kg' 
 75  Rsol_units   = 'm' 
 76  Lsol_units   = 'kg m2 s-3' 
 77  Tsol_units   = 'K' 
 78  agesol_units = 's' 
 79  Mearth_units = 'kg' 
 80  Rearth_units = 'm' 
 81  Mjup_units   = 'kg' 
 82  Rjup_units   = 'm' 
 83  Mlun_units   = 'kg' 
 84  au_units     = 'm' 
 85  pc_units     = 'm' 
 86  ly_units     = 'm' 
 87  hh_units     = 'kg m2 s-1' 
 88  hhbar_units  = 'kg m2 s-1' 
 89  kB_units     = 'kg m2 s-2 K-1' 
 90  NA_units     = 'mol-1' 
 91  sigma_units  = 'kg s-3 K-4' 
 92  GG_units     = 'm3 kg-1 s-2' 
 93  GGMsol_units = 'm3 s-2' 
 94  RR_units     = 'kg m2 s-2 K-1 mol-1' 
 95  aa_units     = 'kg m-1 s-2 K-4' 
 96  a0_units     = 'm' 
 97  ke_units     = 'N m2 C-2' 
 98  eps0_units   = 'F m-1' 
 99  mu0_units    = 'T m A-1' 
100  alpha_units  = '' 
101  me_units     = 'kg' 
102  qe_units     = 'C' 
103  mp_units     = 'kg' 
104  qp_units     = 'C' 
105   
106   
107   
108   
109  # CGS-units 
110  # value                        name                          unit           reference 
111  #==================================================================================== 
112  cc_cgs     = 29979245800.      # speed of light              cm/s 
113  Msol_cgs   = 1.988547e33       # solar mass                  g              Harmanec & Prsa 2011 
114  Rsol_cgs   = 6.95508e10        # solar radius                cm             Harmanec & Prsa 2011 
115  Lsol_cgs   = 3.846e33          # solar luminosity            erg/s          Harmanec & Prsa 2011 
116  Mearth_cgs = 5.9742e27         # earth mass                  g              google 
117  Rearth_cgs = 6371e5            # earth radius                cm             wikipedia 
118  Mjup_cgs   = 1.8986e30         # Jupiter mass                g              wikipedia 
119  Rjup_cgs   = 6.9911e9          # Jupiter radius              cm             mesa 
120  Mlun_cgs   = 7.346e25          # Lunar mass                  g              wikipedia 
121  au_cgs     = 149597.870700e8   # astronomical unit           cm             Harmanec & Prsa 2011 
122  pc_cgs     = 3.085677581503e+18# parsec                      cm             Harmanec & Prsa 2011 
123  ly_cgs     = 9.4605284e+17     # light year                  cm 
124  hh_cgs     = 6.6260689633e-27  # Planck constant             erg/s 
125  hhbar_cgs  = 1.05457162853e-27 # reduced Planck constant     erg/s 
126  kB_cgs     = 1.380650424e-16   # Boltzmann constant          erg/K 
127  sigma_cgs  = 5.67040040e-5     # Stefan-Boltzmann constant   erg/cm2/s/K4   Harmanec & Prsa 2011 
128  GG_cgs     = 6.67384e-8        # gravitational constant      cm3/g/s2       Harmanec & Prsa 2011 
129  GGMsol_cgs = 1.32712442099e26  # grav. constant x solar mass cm3/s2         Harmanec & Prsa 2011 
130  RR_cgs     = 8.31447215e7      # (ideal) gas constant        erg/K/mol 
131  aa_cgs     = 7.5657e-15        # radiation constant          erg/cm2/K4 
132  a0_cgs     = 52.9177e-10       # Bohr radius of hydrogen     cm 
133   
134  # solar units 
135  # value                        name                          unit           reference 
136  #==================================================================================== 
137  Msol_sol  = 1.                 # solar mass                  Msol           Harmanec & Prsa 2011 
138  GG_sol    = 3.944620808727e-07 # gravitional constant        Rsol3/Msol/s2  Harmanec & Prsa 2011 
139  GGMsol_sol= 3.944620719386e-27 # grav. constant x solar mass Rsol3/s2       Harmanec & Prsa 2011 
140   
141  # other stuff 
142  Mabs_sol = 4.75                # solar bolometric abs mag    mag            Harmanec & Prsa 2011 
143  Mapp_sol = -26.74              # solar visual apparent mag   mag 
144  numax_sol = 3120.,5.,'muHz'       # solar frequency of maximum amplitude 
145  Deltanu0_sol = 134.88,0.04,'muHz' # solar large separation (Kallinger, 2010) 
146  dnu01_sol = 6.14,0.10,'muHz'      # solar small separation (Kallinger, 2010) 
147  dnu02_sol = 9.00,0.06,'muHz'      # solar small separation (Kallinger, 2010) 
148   
149   
150  # program specific 
151  #-- CLES evolutionary code 
152  GG_cles      = 6.6742e-11      # SI 
153  Msol_cles    = 1.9884e30       # SI 
154  #-- EGGLETON evolutionary code 
155  GG_eggleton  = 6.6672e-11      # SI 
156  Msol_eggleton= 1.9891e30       # SI 
157  Rsol_eggleton= 6.9598e8        # SI 
158  #-- MESA evolutionary code 
159  GG_mesa      = 6.67428e-11     # SI 
160  Msol_mesa    = 1.9892e30       # SI 
161  Rsol_mesa    = 6.9598e8        # SI 
162  Lsol_mesa    = 3.8418e26       # SI 
163  Mearth_mesa  = 5.9764e24       # SI 
164  Rearth_mesa  = 6.37e6          # SI 
165  au_mesa      = 1.495978921e11  # SI 
166  #-- ESTA project 
167  Rsol_esta = 6.9599e8           # SI 
168  Lsol_esta = 3.846e26           # SI 
169  GGMsol_esta = 1.32712438e20    # SI 
170  GG_esta   = 6.6716823e-11      # SI 
171  Msol_esta = 1.98919e8          # SI 
172  Tsol_esta = 5777.54            # SI 
173   
174  # Atomic masses (http://pntpm3.ulb.ac.be/Nacre/introduction.html) 
175  # Element   Atomic mass (amu) 
176  #================================================================ 
177  n   =  1.0086649242   
178  H1  =  1.0078250321   
179  H2  =  2.0141017781   
180  H3  =  3.0160492681   
181  He3 =  3.0160293091   
182  He4 =  4.0026032501   
183  Li6 =  6.015122306509 
184  Li7 =  7.016004073506 
185  Be7 =  7.016929269506 
186  Be8 =  8.00530509538  
187  B8  =  8.0246067271188  
188  Be9 =  9.012182248405   
189  B9  =  9.01332889191047 
190  B10 = 10.012937097349  
191  B11 = 11.009305514405  
192  C12 = 12.000000000  
193  C13 = 13.0033548385 
194  N13 = 13.005738584289 
195  C14 = 14.0032419914  
196  N14 = 14.0030740072  
197  O14 = 14.00859528780 
198  N15 = 15.00010897312 
199  O15 = 15.003065460540 
200  O16 = 15.9949146223  
201  O17 = 16.999131501223    
202  F17 = 17.002095238266    
203  O18 = 17.999160413851    
204  F18 = 18.000937665636    
205  F19 = 18.99840320575     
206  Ne19= 19.001879726612 
207  Ne20= 19.9924401763  
208  Ne21= 20.99384674443    
209  Na21= 20.997655100751   
210  Ne22= 21.991385500252   
211  Na22= 21.994436633482   
212  Na23= 22.989769657262   
213  Mg23= 22.9941248281353  
214  Mg24= 23.985041874258   
215  Mg25= 24.985837000261   
216  Al25= 24.990428531760 
217  Mg26= 25.982592999264   
218  Al26= 25.986891675268   
219  Al27= 26.981538407238   
220  Si27= 26.986704124264   
221  Si28= 27.976926494216   
222  Si29= 28.976494680219   
223  P29 = 28.981801337807    
224  Si30= 29.973770179221   
225  P30 = 29.978313768482    
226  P31 = 30.973761487269 
227