virt_temp (version 0.2.0.2)
index
virt_temp.py

Single-function module.
 
See function docstring for description.

 
Functions
       
virt_temp(r_in, T_in, missing=1e+20)
Calculate virtual temperature.
 
Method Arguments:
* r_in:  Mixing ratio [kg/kg].  Numeric floating point array of any
  number of dimensions and size.  Required.
* T_in:  Temperature [K].  Numeric floating point array of any
  number of dimensions and size.  Required.
* missing:  If r_in and/or T_in has missing values, this is the 
  missing value value.  Floating point scalar.  Default is 1e+20.
 
Output:
* Virtual temperature [K].  Numeric array of same dimensions and 
  size as input.  If there are any missing values in output, those 
  values are set to the value in argument missing from the input.
  If there are missing values in the output due to math errors and 
  missing is set to None, output will fill those missing values 
  with the MA default value of 1e+20.
 
Reference:
* Emanuel, K. A. (1994):  Atmospheric Convection.  New York, NY:
  Oxford University Press, 580 pp.
 
Example without missing values:
>>> from virt_temp import virt_temp
>>> import Numeric as N
>>> r = N.array([5.5e-3, 15e-3, 8.9e-3])
>>> T = N.array([273.1, 290.2, 288.4])
>>> a = virt_temp(r, T)
>>> ['%.8g' % a[i] for i in range(len(a))]
['274.00801', '292.80682', '289.94641']
 
Example with missing values:
>>> r = N.array([5.5e-3, 5.4e-3, 6.2e-3, 18e-3])
>>> T = N.array([283.9, 290.2, 1e+20, 305.7])
>>> a = virt_temp(r, T, missing=1e+20)
>>> ['%.8g' % a[i] for i in range(len(a))]
['284.84392', '291.14742', '1e+20', '308.98555']

 
Data
        __test__ = {'Additional Example 1': '\n >>> from virt_temp import virt_temp\n >>>...ueError: virt_temp: r and T likely reversed\n '}
__version__ = '0.2.0.2'