Functions | Variables
snow Namespace Reference

Functions

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

Variables

dictionary compositions
 
dictionary fractions
 

Function Documentation

def snow.elem_frac (   compos,
  elem 
)

Definition at line 31 of file snow.py.

References tot_weight().

Referenced by elem_frac_total().

31 def elem_frac(compos, elem):
32  if elem in compos:
33  return compos[elem] * atomic_weight[elem] / tot_weight(compos)
34  else:
35  return 0
36 
def elem_frac(compos, elem)
Definition: snow.py:31
def tot_weight(compos)
Definition: snow.py:19
def snow.elem_frac_total (   elem)

Definition at line 37 of file snow.py.

References elem_frac(), and tot_fractions().

37 def elem_frac_total(elem):
38  frac = 0
39  for material, compos in compositions.items():
40  frac += elem_frac(compos, elem) * fractions[material]
41  return frac / tot_fractions()
42 
def elem_frac(compos, elem)
Definition: snow.py:31
def elem_frac_total(elem)
Definition: snow.py:37
def tot_fractions()
Definition: snow.py:25
def snow.snow_composition ( )

Definition at line 43 of file snow.py.

References util.make_composition().

44  return make_composition("snow", fractions, compositions)
45 
def snow_composition()
Definition: snow.py:43
def make_composition(name, fractions, compositions)
Definition: util.py:46
def snow.tot_fractions ( )

Definition at line 25 of file snow.py.

Referenced by elem_frac_total().

26  tions = 0
27  for material, fraction in fractions.items():
28  tions += fraction
29  return tions
30 
def tot_fractions()
Definition: snow.py:25
def snow.tot_weight (   compos)

Definition at line 19 of file snow.py.

Referenced by elem_frac().

19 def tot_weight(compos):
20  weight = 0
21  for element, number in compos.items():
22  weight += number * atomic_weight[element]
23  return weight
24 
def tot_weight(compos)
Definition: snow.py:19

Variable Documentation

dictionary snow.compositions
Initial value:
1 = {
2  'water': { 'H' : 2, 'O': 1 },
3 }

Definition at line 10 of file snow.py.

dictionary snow.fractions
Initial value:
1 = {
2  'water': 1,
3 }

Definition at line 14 of file snow.py.