| |
- theta(p_in, T_in, p0=1000.0, missing=1e+20)
- Calculate potential temperature.
The reference pressure is set to 1000 hPa by default. To use a
different reference pressure, set p0 to a different value when
calling the method.
Method Arguments:
* p_in: Pressure [hPa]. Numeric floating point array.
Required.
* T_in: Temperature [K]. Numeric floating point array.
Required.
* p0: Reference pressure [hPa]. Floating point scalar.
Optional.
* missing: If p_in and/or T_in has missing values, this is the
missing value value. Floating point scalar. Default is 1e+20.
Optional.
Arguments p_in and T_in can be Numeric arrays of any number of
dimensions, as long as they are of the same shape and size.
Output:
* Potential temperature [K]. Numeric floating point array of
same dimensions and size as arguments. 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:
* Wallace, J. M., and P. V. Hobbs (1977): Atmospheric Science:
An Introductory Survey. San Diego, CA: Academic Press, ISBN
0-12-732950-1, p 69.
Example without missing values:
>>> import theta
>>> import Numeric as N
>>> p = N.array([1000., 1010., 1008.2])
>>> T = N.array([273.1, 280.2, 278.4])
>>> a = theta.theta(p, T)
>>> ['%.8g' % a[i] for i in range(len(a))]
['273.1', '279.404', '277.75073']
Example with missing values:
>>> import theta
>>> import Numeric as N
>>> p = N.array([1000., 1010., 1008.2])
>>> T = N.array([273.1, 1e20, 278.4])
>>> a = theta.theta(p, T, missing=1e20)
>>> ['%.8g' % a[i] for i in range(len(a))]
['273.1', '1e+20', '277.75073']
|