| |
- mix_ratio(variables)
- Calculate mixing ratio over liquid water.
Method Arguments:
* variables: A dictionary of input state variables, where for
each key:value pair the key labels what state variable it is
and the value is the state variable. The value is a Numeric
floating point array of any number of dimensions and size.
All state variables must be arrays of the same shape and size.
Argument variables can have any number of items. Key values
may be any value, but values that may be used by this function
include:
+ 'e': Vapor pressure over water [hPa].
+ 'p': Total pressure [hPa].
+ 'q': Specific humidity [kg/kg].
Output:
* Mixing ratio [kg/kg]. Numeric array of same dimensions and
size as state variables in the argument.
The mixing ratio can be calculated from a variety of different
combinations of state variables. In this function, the following
combinations are supported:
* Vapor pressure and total pressure.
* Specific humidity.
The function will automatically apply the correct equation
depending on the key values of the argument dictionary. An
error is returned if none of the above combinations are present
as the input argument.
Reference:
* Emanuel, K. A. (1994): Atmospheric Convection. New York, NY:
Oxford University Press, 580 pp.
Example:
>>> from mix_ratio import mix_ratio
>>> import Numeric as N
>>> p = N.array([1026.8])
>>> e = N.array([9.00051379])
>>> r = mix_ratio({'p':p, 'e':e})
>>> r
array([5.5e-3])
|