hesseflux.esat¶
esat : Saturation vapour pressure of water and ice.
This module was written by Matthias Cuntz while at Department of Computational Hydrosystems, Helmholtz Centre for Environmental Research - UFZ, Leipzig, Germany, and continued while at Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement (INRAE), Nancy, France.
Copyright (c) 2012-2020 Matthias Cuntz - mc (at) macu (dot) de Released under the MIT License; see LICENSE file for details.
- Written Jan 2012 by Matthias Cuntz (mc (at) macu (dot) de)
- Ported to Python 3, Feb 2013, Matthias Cuntz
- Changed handling of masked arrays, Oct 2013, Matthias Cuntz
- Assert T>0, Apr 2014, Matthias Cuntz
- Using numpy docstring format, May 2020, Matthias Cuntz
The following functions are provided
esat (T[, liquid, formula]) |
Calculates the saturation vapour pressure of water and/or ice. |
-
esat
(T, liquid=False, formula='GoffGratch')[source]¶ Calculates the saturation vapour pressure of water and/or ice.
For temperatures above (and equal) 0 degree C (273.15 K), the vapour pressure over liquid water is calculated. For temperatures below 0 degree C, the vapour pressure over ice is calculated.
The optional parameter liquid=True changes the calculation to vapour pressure over liquid water over the entire temperature range.
Parameters: - T (float or array_like) – Temperature [K]
- liquid (bool, optional) – If True, use liquid formula for all temperatures.
- formula (str, optional) –
Name of reference to use for calculations, case-insensitive (default: GoffGratch).
Note that several formulations do not provide a vapour pressure formulation over ice and Marti and Mauersberger do not provide a formula over liquid: GoffGratch is used in theses cases.
GoffGratch: Smithsonian Tables, 1984; after Goff and Gratch, 1946 (default)
MartiMauersberger: Marti and Mauersberger, 1993
MagnusTeten: Murray, 1967
Buck_original: Buck, 1981
Buck: Buck Research Manual, 1996
WMO: Goff, 1957; WMO 1988, 2000
Wexler: Wexler, 1977
Sonntag: Sonntag, 1994
Bolton: Bolton, 1980
Fukuta: Fukuta, N. and C. M. Gramada, 2003
HylandWexler: Hyland and Wexler, 1983
IAPWS: Wagner and Pruss, 2002
MurphyKoop: Murphy and Koop, 2005
Returns: Saturation water pressure at temperature T in Pascal [Pa].
Return type: float or array_like
Notes
From Holger Voemel: http://cires.colorado.edu/~voemel/vp.html
Referred literature cited in code.
Examples
>>> print('{:.3f}'.format(esat(293.15))) 2335.847 >>> print('{:.3f}'.format(esat(253.15))) 103.074
>>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15]))) 2335.847 103.074 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='GoffGratch'))) 2335.847 103.074 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='MartiMauersberger'))) 2335.847 103.650 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='MagnusTeten'))) 2335.201 102.771 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='buck'))) 2338.340 103.286 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='Buck_original'))) 2337.282 103.267 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='wmo'))) 2337.080 103.153 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='WEXLER'))) 2323.254 103.074 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='Sonntag'))) 2339.249 103.249 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='Bolton'))) 2336.947 103.074 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='Fukuta'))) 2335.847 103.074 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='HylandWexler'))) 2338.804 103.260 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='IAPWS'))) 2339.194 103.074 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='MurphyKoop'))) 2339.399 103.252
>>> print('{:.3f} {:.3f}'.format(*esat(np.array([293.15,253.15]), liquid=True))) 2335.847 125.292 >>> print('{:.3f} {:.3f}'.format(*esat([293.15,253.15],formula='Fukuta', liquid=True))) 2335.847 125.079
>>> print('{:.3f} {:.3f}'.format(*esat(np.array([293.15,393.15])))) esat.py: UserWarning: T>373.15 K - something might be wrong with T. 2335.847 198473.378 >>> print('{:.3f} {:.3f}'.format(*esat(np.array([293.15,93.15])))) esat.py: UserWarning: T<100 - T probably given in Celsius instead of Kelvin. 2335.847 0.000
>>> out = esat(np.ma.array([253.15,-9999.], mask=[False,True])) >>> print('{:.3f} {:.3f}'.format(*out.filled(-9999.))) 103.074 -9999.000