Skip to content

Commit

Permalink
adjusted expected cin in test_thermo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ahijevyc committed Feb 12, 2025
1 parent 804be43 commit 6ef1e98
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/calc/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ def test_cape_cin():
parcel_prof = parcel_profile(p, temperature[0], dewpoint[0])
cape, cin = cape_cin(p, temperature, dewpoint, parcel_prof)
assert_almost_equal(cape, 228.61081997000744 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -9.94798721 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -20.8938 * units('joule / kilogram'), 2)


def test_cape_cin_no_el():
Expand All @@ -1203,7 +1203,7 @@ def test_cape_cin_no_el():
parcel_prof = parcel_profile(p, temperature[0], dewpoint[0]).to('degC')
cape, cin = cape_cin(p, temperature, dewpoint, parcel_prof)
assert_almost_equal(cape, 11.10149 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -9.947987213 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -20.8938 * units('joule / kilogram'), 2)


def test_cape_cin_no_lfc():
Expand Down Expand Up @@ -1601,7 +1601,7 @@ def test_surface_based_cape_cin(array_class):
dewpoint = array_class([19., -11.2, -10.8, -10.4, -10., -53.2], units.celsius)
cape, cin = surface_based_cape_cin(p, temperature, dewpoint)
assert_almost_equal(cape, 228.61081997000744 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -33.0633599455 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -52.46449098033761 * units('joule / kilogram'), 2)


def test_surface_based_cape_cin_with_xarray():
Expand All @@ -1625,7 +1625,7 @@ def test_surface_based_cape_cin_with_xarray():
data['dewpoint']
)
assert_almost_equal(cape, 228.61081997000744 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -33.0633599455 * units('joule / kilogram'), 2)
assert_almost_equal(cin, -52.46449098033761 * units('joule / kilogram'), 2)


def test_profile_with_nans():
Expand Down Expand Up @@ -1666,7 +1666,7 @@ def test_most_unstable_cape_cin_surface():
dewpoint = np.array([19., -11.2, -10.8, -10.4, -10., -53.2]) * units.celsius
mucape, mucin = most_unstable_cape_cin(pressure, temperature, dewpoint)
assert_almost_equal(mucape, 228.61081997000744 * units('joule / kilogram'), 2)
assert_almost_equal(mucin, -33.0633599455 * units('joule / kilogram'), 2)
assert_almost_equal(mucin, -52.46449098033761 * units('joule / kilogram'), 2)


def test_most_unstable_cape_cin():
Expand All @@ -1675,7 +1675,7 @@ def test_most_unstable_cape_cin():
temperature = np.array([18.2, 22.2, 17.4, 10., 0., 15]) * units.celsius
dewpoint = np.array([19., 19., 14.3, 0., -10., 0.]) * units.celsius
mucape, mucin = most_unstable_cape_cin(pressure, temperature, dewpoint)
assert_almost_equal(mucape, 173.749389796 * units('joule / kilogram'), 4)
assert_almost_equal(mucape, 189.41067504060692 * units('joule / kilogram'), 4)
assert_almost_equal(mucin, -20.968278741 * units('joule / kilogram'), 4)


Expand All @@ -1697,7 +1697,7 @@ def test_mixed_layer_cape_cin(multiple_intersections):
pressure, temperature, dewpoint = multiple_intersections
mlcape, mlcin = mixed_layer_cape_cin(pressure, temperature, dewpoint)
assert_almost_equal(mlcape, 1143.3981 * units('joule / kilogram'), 2)
assert_almost_equal(mlcin, -13.4809966289 * units('joule / kilogram'), 2)
assert_almost_equal(mlcin, -16.240379524041845 * units('joule / kilogram'), 2)


def test_mixed_layer_cape_cin_bottom_pressure(multiple_intersections):
Expand All @@ -1706,7 +1706,7 @@ def test_mixed_layer_cape_cin_bottom_pressure(multiple_intersections):
mlcape_middle, mlcin_middle = mixed_layer_cape_cin(pressure, temperature, dewpoint,
parcel_start_pressure=903 * units.hPa)
assert_almost_equal(mlcape_middle, 1200.528254 * units('joule / kilogram'), 2)
assert_almost_equal(mlcin_middle, -37. * units('joule / kilogram'), 2)
assert_almost_equal(mlcin_middle, -46.99243161905505 * units('joule / kilogram'), 2)


def test_dcape():
Expand Down Expand Up @@ -2188,7 +2188,7 @@ def test_cape_cin_top_el_lfc(multiple_intersections):
parcel_prof = parcel_profile(levels, temperatures[0], dewpoints[0]).to('degC')
cape, cin = cape_cin(levels, temperatures, dewpoints, parcel_prof, which_lfc='top')
assert_almost_equal(cape, 1371.747661 * units('joule / kilogram'), 3)
assert_almost_equal(cin, -35.179268355 * units('joule / kilogram'), 3)
assert_almost_equal(cin, -46.084968610767184 * units('joule / kilogram'), 3)


def test_cape_cin_bottom_el_lfc(multiple_intersections):
Expand All @@ -2197,7 +2197,7 @@ def test_cape_cin_bottom_el_lfc(multiple_intersections):
parcel_prof = parcel_profile(levels, temperatures[0], dewpoints[0]).to('degC')
cape, cin = cape_cin(levels, temperatures, dewpoints, parcel_prof, which_el='bottom')
assert_almost_equal(cape, 4.76113 * units('joule / kilogram'), 3)
assert_almost_equal(cin, -5.9471237534 * units('joule / kilogram'), 3)
assert_almost_equal(cin, -7.058249615394496 * units('joule / kilogram'), 3)


def test_cape_cin_wide_el_lfc(multiple_intersections):
Expand All @@ -2207,7 +2207,7 @@ def test_cape_cin_wide_el_lfc(multiple_intersections):
cape, cin = cape_cin(levels, temperatures, dewpoints, parcel_prof, which_lfc='wide',
which_el='wide')
assert_almost_equal(cape, 1371.747661 * units('joule / kilogram'), 3)
assert_almost_equal(cin, -35.179268355 * units('joule / kilogram'), 3)
assert_almost_equal(cin, -46.084968610767184 * units('joule / kilogram'), 3)


def test_cape_cin_custom_profile():
Expand Down

0 comments on commit 6ef1e98

Please sign in to comment.