Skip to content

Commit

Permalink
Merge pull request #1554 from dopplershift/montgomery
Browse files Browse the repository at this point in the history
MNT: Refactor montgomery_streamfunction
  • Loading branch information
dcamron committed Nov 2, 2020
2 parents 54129e6 + b856fb7 commit e20380f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/metpy/calc/kinematics.py
Expand Up @@ -484,8 +484,6 @@ def ageostrophic_wind(height, u, v, dx=None, dy=None, latitude=None, x_dim=-1, y


@exporter.export
@preprocess_and_wrap(wrap_like='height', broadcast=('height', 'temperature'))
@check_units('[length]', '[temperature]')
def montgomery_streamfunction(height, temperature):
r"""Compute the Montgomery Streamfunction on isentropic surfaces.
Expand Down Expand Up @@ -519,10 +517,11 @@ def montgomery_streamfunction(height, temperature):
See Also
--------
get_isentropic_pressure
get_isentropic_pressure, dry_static_energy
"""
return (mpconsts.g * height) + (mpconsts.Cp_d * temperature)
from . import dry_static_energy
return dry_static_energy(height, temperature)


@exporter.export
Expand Down
4 changes: 4 additions & 0 deletions src/metpy/calc/thermo.py
Expand Up @@ -2358,6 +2358,10 @@ def dry_static_energy(height, temperature):
`pint.Quantity`
The dry static energy
See Also
--------
montgomery_streamfunction
"""
return (mpconsts.g * height + mpconsts.Cp_d * temperature).to('kJ/kg')

Expand Down

0 comments on commit e20380f

Please sign in to comment.