|
@@ 358-370 (lines=13) @@
|
| 355 |
|
assert_almost_equal(isentprs[1], truerh, 3) |
| 356 |
|
|
| 357 |
|
|
| 358 |
|
def test_isentropic_pressure_tmp_out(): |
| 359 |
|
"""Test calculation of isentropic pressure function, temperature output.""" |
| 360 |
|
lev = [100000., 95000., 90000., 85000.] * units.Pa |
| 361 |
|
tmp = np.ones((4, 5, 5)) |
| 362 |
|
tmp[0, :] = 296. |
| 363 |
|
tmp[1, :] = 292. |
| 364 |
|
tmp[2, :] = 290. |
| 365 |
|
tmp[3, :] = 288. |
| 366 |
|
tmpk = tmp * units.kelvin |
| 367 |
|
isentlev = [296.] * units.kelvin |
| 368 |
|
isentprs = get_isentropic_pressure(isentlev, lev, tmpk, tmpk_out=True) |
| 369 |
|
truetmp = 296. * units.kelvin |
| 370 |
|
assert_almost_equal(isentprs[1], truetmp, 3) |
| 371 |
|
|
| 372 |
|
|
| 373 |
|
def test_isentropic_pressure_p_increase_rh_out(): |
|
@@ 322-334 (lines=13) @@
|
| 319 |
|
assert_almost_equal(isentprs[0], trueprs, 3) |
| 320 |
|
|
| 321 |
|
|
| 322 |
|
def test_isentropic_pressure_p_increase(): |
| 323 |
|
"""Test calculation of isentropic pressure function, p increasing order.""" |
| 324 |
|
lev = [85000, 90000., 95000., 100000.] * units.Pa |
| 325 |
|
tmp = np.ones((4, 5, 5)) |
| 326 |
|
tmp[0, :] = 288. |
| 327 |
|
tmp[1, :] = 290. |
| 328 |
|
tmp[2, :] = 292. |
| 329 |
|
tmp[3, :] = 296. |
| 330 |
|
tmpk = tmp * units.kelvin |
| 331 |
|
isentlev = [296.] * units.kelvin |
| 332 |
|
isentprs = get_isentropic_pressure(isentlev, lev, tmpk) |
| 333 |
|
trueprs = 1000. * units.hPa |
| 334 |
|
assert_almost_equal(isentprs[0], trueprs, 3) |
| 335 |
|
|
| 336 |
|
|
| 337 |
|
def test_isentropic_pressure_adition_args(): |
|
@@ 307-319 (lines=13) @@
|
| 304 |
|
assert_almost_equal(psychrometric_rh, 82.9701 * units.percent, 3) |
| 305 |
|
|
| 306 |
|
|
| 307 |
|
def test_isentropic_pressure(): |
| 308 |
|
"""Test calculation of isentropic pressure function.""" |
| 309 |
|
lev = [100000., 95000., 90000., 85000.] * units.Pa |
| 310 |
|
tmp = np.ones((4, 5, 5)) |
| 311 |
|
tmp[0, :] = 296. |
| 312 |
|
tmp[1, :] = 292. |
| 313 |
|
tmp[2, :] = 290 |
| 314 |
|
tmp[3, :] = 288. |
| 315 |
|
tmpk = tmp * units.kelvin |
| 316 |
|
isentlev = [296.] * units.kelvin |
| 317 |
|
isentprs = get_isentropic_pressure(isentlev, lev, tmpk) |
| 318 |
|
trueprs = 1000. * units.hPa |
| 319 |
|
assert_almost_equal(isentprs[0], trueprs, 3) |
| 320 |
|
|
| 321 |
|
|
| 322 |
|
def test_isentropic_pressure_p_increase(): |