| |
- static_stability(T_in, z_in, missing=1e+20)
- Calculate static stability.
The static stability is also known as the square of the buoyancy
frequency, or the square of the Brunt-Vaisala frequency. If the
static stability is N**2, the period of a buoyancy oscillation
is 2*pi/N.
Method Positional Arguments:
* T_in: Air temperature [K]. 1-D Numeric floating point vector.
* z_in: The elevation [m] of each element of T_in. 1-D Numeric
floating point vector of same size as T_in.
* missing: If T_in and/or z_in has missing values, this is the
missing value value. Floating point scalar. Default is 1e+20.
Output:
* Static stability [1/s**2] at each element of T_in. Numeric
floating point array of the same size and shape as input T_in.
If there are any missing values in output, those values are
set to the value in argument missing from the input. For
instance, if T_in is only one element, a one-element vector is
returned as the derivative with the value of argument missing.
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.
References:
* Iredell, Mark: "How does NCEP/NCAR reanalaysis compute the
potential vorticity on isentropic surfaces?" NCEP/NCAR Reanaly-
sis FAQ: http://dss.ucar.edu/pub/reanalysis/FAQ.html.
* Wallace, J. M., and P. V. Hobbs (1977): Atmospheric Science:
An Introductory Survey. San Diego, CA: Academic Press, ISBN
0-12-732950-1, p. 237.
Example without missing values:
>>> from static_stability import static_stability
>>> import Numeric as N
>>> T = N.array([283.1, 280.2, 278.4, 277.1])
>>> z = N.array([ 0.0, 100.1, 230.9, 350.5])
>>> N2 = static_stability(T, z)
>>> ['%.5g' % N2[i] for i in range(4)]
['-0.00066521', '-0.00037055', '-9.2029e-05', '-3.9e-05']
Example with missing values:
>>> T = N.array([283.1, 280.2, 278.4, 277.1])
>>> z = N.array([ 0.0, 100.1, 1e+20, 350.5])
>>> N2 = static_stability(T, z, missing=1e+20)
>>> ['%.5g' % N2[i] for i in range(4)]
['-0.00066521', '1e+20', '-9.2029e-05', '1e+20']
Note how N2[2] is not missing, even though z[2] is, because the
algorithm for static stability at N2[2] does not use z[2], al-
though it does use T[2].
|