Classes | Functions | Variables
air Namespace Reference

Classes

class  AirFilter
 
class  AirKalmanAna
 
class  AirShower
 
class  AirTree
 
class  CosmicTrackRate
 

Functions

def tot_weight (compos)
 
def tot_fractions ()
 
def elem_frac (compos, elem)
 
def elem_frac_total (elem)
 
def air_composition ()
 

Variables

dictionary compositions
 
dictionary fractions
 

Function Documentation

def air.air_composition ( )

Definition at line 49 of file air.py.

References util.make_composition().

50  return make_composition("air", fractions, compositions)
51 
def air_composition()
Definition: air.py:49
def make_composition(name, fractions, compositions)
Definition: util.py:46
def air.elem_frac (   compos,
  elem 
)

Definition at line 37 of file air.py.

References tot_weight().

Referenced by elem_frac_total().

37 def elem_frac(compos, elem):
38  if elem in compos:
39  return compos[elem] * atomic_weight[elem] / tot_weight(compos)
40  else:
41  return 0
42 
def tot_weight(compos)
Definition: air.py:25
def elem_frac(compos, elem)
Definition: air.py:37
def air.elem_frac_total (   elem)

Definition at line 43 of file air.py.

References elem_frac(), and tot_fractions().

43 def elem_frac_total(elem):
44  frac = 0
45  for material, compos in compositions.items():
46  frac += elem_frac(compos, elem) * fractions[material]
47  return frac / tot_fractions()
48 
def elem_frac_total(elem)
Definition: air.py:43
def tot_fractions()
Definition: air.py:31
def elem_frac(compos, elem)
Definition: air.py:37
def air.tot_fractions ( )

Definition at line 31 of file air.py.

Referenced by elem_frac_total().

32  tions = 0
33  for material, fraction in fractions.items():
34  tions += fraction
35  return tions
36 
def tot_fractions()
Definition: air.py:31
def air.tot_weight (   compos)

Definition at line 25 of file air.py.

Referenced by elem_frac().

25 def tot_weight(compos):
26  weight = 0
27  for element, number in compos.items():
28  weight += number * atomic_weight[element]
29  return weight
30 
def tot_weight(compos)
Definition: air.py:25

Variable Documentation

dictionary air.compositions
Initial value:
1 = {
2  # Don't include argon (neon, etc.) because it isn't otherwise in the model
3  'nitrogen': { 'N': 2 },
4  'oxygen': { 'O': 2 },
5  'water': { 'H': 2, 'O': 1 },
6  'carbon dioxide': { 'C': 1, 'O': 2 },
7 }

Definition at line 4 of file air.py.

dictionary air.fractions
Initial value:
1 = {
2  # Take the mole fractions from Wikipedia "Atmospheric chemistry" and convert
3  # to number proportional to mass fractions
4  'nitrogen': 0.78084 * 2 * 14.007,
5  'oxygen': 0.20946 * 2 * 15.999,
6 
7  # I think this is the right ballpark for our moderate humidity
8  'water': 0.007 * (2 * 1.008 + 15.999),
9 
10  'carbon dioxide': 400e-6 * (12.011 + 2 * 15.999),
11 }

Definition at line 12 of file air.py.