Skip to content

Commit

Permalink
rename to downdraft_cape
Browse files Browse the repository at this point in the history
  • Loading branch information
wx4stg authored Oct 19, 2023
1 parent d701b3e commit 56a9e4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/_templates/overrides/metpy.calc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Soundings
storm_relative_helicity
supercell_composite
surface_based_cape_cin
down_cape
downdraft_cape
sweat_index
total_totals_index
vertical_totals
Expand Down
6 changes: 3 additions & 3 deletions src/metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3030,7 +3030,7 @@ def mixed_layer_cape_cin(pressure, temperature, dewpoint, **kwargs):

@exporter.export
@preprocess_and_wrap()
def down_cape(pressure, temperature, dewpoint):
def downdraft_cape(pressure, temperature, dewpoint):
r"""Calculate downward CAPE (DCAPE).
Calculate the downward convective available potential energy (DCAPE) of a given upper air
Expand Down Expand Up @@ -3062,7 +3062,7 @@ def down_cape(pressure, temperature, dewpoint):
Examples
--------
>>> from metpy.calc import dewpoint_from_relative_humidity, down_cape
>>> from metpy.calc import dewpoint_from_relative_humidity, downdraft_cape
>>> from metpy.units import units
>>> # pressure
>>> p = [1008., 1000., 950., 900., 850., 800., 750., 700., 650., 600.,
Expand All @@ -3080,7 +3080,7 @@ def down_cape(pressure, temperature, dewpoint):
... .56, .88, .39, .67, .15, .04, .94, .35] * units.dimensionless
>>> # calculate dewpoint
>>> Td = dewpoint_from_relative_humidity(T, rh)
>>> down_cape(p, T, Td)
>>> downdraft_cape(p, T, Td)
(<Quantity(1222.67968, 'joule / kilogram')>, <Quantity([1008. 1000. 950.
900. 850. 800. 750. 700. 650. 600.], 'hectopascal')>, <Quantity([17.50959548
17.20643425 15.237249 13.12607097 10.85045704 8.38243809 5.68671014 2.71808363
Expand Down
4 changes: 2 additions & 2 deletions tests/calc/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from metpy.calc import (brunt_vaisala_frequency, brunt_vaisala_frequency_squared,
brunt_vaisala_period, cape_cin, ccl, cross_totals, density, dewpoint,
dewpoint_from_relative_humidity, dewpoint_from_specific_humidity,
down_cape, dry_lapse, dry_static_energy, el,
downdraft_cape, dry_lapse, dry_static_energy, el,
equivalent_potential_temperature, exner_function,
gradient_richardson_number, InvalidSoundingError,
isentropic_interpolation, isentropic_interpolation_as_dataset, k_index,
Expand Down Expand Up @@ -1566,7 +1566,7 @@ def test_dcape():
-16.6, -9.2, -9.9, -14.6, -32.8, -51.2, -32.7, -42.6, -58.9,
-69.5, -71.7, -75.9, -79.3, -79.7, -72.5, -73.3, -64.3, -70.6,
-75.8, -51.2, -56.4] * units.degC
dcape, down_press, down_t = down_cape(pressure, temperature, dewpoint)
dcape, down_press, down_t = downdraft_cape(pressure, temperature, dewpoint)
assert_almost_equal(dcape, 1222 * units('joule / kilogram'), 0)
assert_array_almost_equal(down_press, pressure[:10], 0)
assert_almost_equal(down_t, [17.5, 17.2, 15.2, 13.1, 10.9, 8.4,
Expand Down

0 comments on commit 56a9e4c

Please sign in to comment.