|
@@ 204-211 (lines=8) @@
|
| 201 |
|
assert assertIsUnitNan(lfc_temperature, temperatures.units) |
| 202 |
|
|
| 203 |
|
|
| 204 |
|
def test_lfc_inversion(): |
| 205 |
|
"""Test LFC when there is an inversion to be sure we don't pick that.""" |
| 206 |
|
levels = np.array([963., 789., 782.3, 754.8, 728.1, 727., 700., |
| 207 |
|
571., 450., 300., 248.]) * units.mbar |
| 208 |
|
temperatures = np.array([25.4, 18.4, 17.8, 15.4, 12.9, 12.8, |
| 209 |
|
10., -3.9, -16.3, -41.1, -51.5]) * units.celsius |
| 210 |
|
dewpoints = np.array([20.4, 0.4, -0.5, -4.3, -8., -8.2, -9., |
| 211 |
|
-23.9, -33.3, -54.1, -63.5]) * units.celsius |
| 212 |
|
l = lfc(levels, temperatures, dewpoints) |
| 213 |
|
assert_almost_equal(l[0], 706.0103 * units.mbar, 2) |
| 214 |
|
assert_almost_equal(l[1], 10.6232 * units.celsius, 2) |
|
@@ 184-191 (lines=8) @@
|
| 181 |
|
lcl(1000. * units.mbar, 30. * units.degC, 20. * units.degC, max_iters=2) |
| 182 |
|
|
| 183 |
|
|
| 184 |
|
def test_lfc_basic(): |
| 185 |
|
"""Test LFC calculation.""" |
| 186 |
|
levels = np.array([959., 779.2, 751.3, 724.3, 700., 269.]) * units.mbar |
| 187 |
|
temperatures = np.array([22.2, 14.6, 12., 9.4, 7., -49.]) * units.celsius |
| 188 |
|
dewpoints = np.array([19., -11.2, -10.8, -10.4, -10., -53.2]) * units.celsius |
| 189 |
|
l = lfc(levels, temperatures, dewpoints) |
| 190 |
|
assert_almost_equal(l[0], 727.468 * units.mbar, 2) |
| 191 |
|
assert_almost_equal(l[1], 9.705 * units.celsius, 2) |
| 192 |
|
|
| 193 |
|
|
| 194 |
|
def test_no_lfc(): |