Skip to content

Commit

Permalink
In saturation_mixing_ratio, add Notes section and move citation for i…
Browse files Browse the repository at this point in the history
…mplementation to Notes. Also add an equation for the implementation following the citation.
  • Loading branch information
rpmanser committed May 27, 2020
1 parent 3cd8bd0 commit 2847b25
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,20 +909,26 @@ def mixing_ratio(partial_press, total_press, molecular_weight_ratio=mpconsts.eps
def saturation_mixing_ratio(total_press, temperature):
r"""Calculate the saturation mixing ratio of water vapor.
This calculation is given total pressure and the temperature. The implementation
uses the formula outlined in [Hobbs1977]_ pg.73.
This calculation is given total atmospheric pressure and air temperature.
Parameters
----------
total_press: `pint.Quantity`
Total atmospheric pressure
temperature: `pint.Quantity`
air temperature
Air temperature
Returns
-------
`pint.Quantity`
The saturation mixing ratio, dimensionless
Saturation mixing ratio, dimensionless
Notes
-----
This function is a straightforward implementation of the equation given in many places,
such as [Hobbs1977]_ pg.73:
.. math:: r_s = \epsilon \frac{e_s}{p - e_s}
"""
return mixing_ratio(saturation_vapor_pressure(temperature), total_press)
Expand Down

0 comments on commit 2847b25

Please sign in to comment.