meteo_utils package¶
Created on Apr 6 2015 @author: Hector Nieto (hnieto@ias.csic.es)
Modified on feb 3 2016 @author: Hector Nieto (hnieto@ias.csic.es)
DESCRIPTION¶
This package contains functions for estimating meteorological variables needed in resistance energy balance models.
PACKAGE CONTENTS¶
calc_c_p()
Heat capacity of air at constant pressure.calc_lambda(T_A_K)()
Latent heat of vaporization.calc_pressure()
Barometric pressure.calc_psicr()
Psicrometric constant.calc_rho()
Density of air.calc_stephan_boltzmann()
Stephan-Boltzmann law for blackbody radiation emission.calc_theta_s()
Sun Zenith Angle.calc_sun_angles()
Sun Zenith and Azimuth Angles.calc_vapor_pressure()
Saturation water vapour pressure.calc_delta_vapor_pressure()
Slope of saturation water vapour pressure.calc_mixing_ratio()
Ration of mass of water vapour to mass of dry air.calc_lapse_rate_moist()
Moist-adiabatic lapse rate.flux_2_evaporation()
Evaporation rate.
-
pyTSEB.meteo_utils.
calc_c_p
(p, ea)[source]¶ Calculates the heat capacity of air at constant pressure.
Parameters: Returns: c_p
Return type: heat capacity of (moist) air at constant pressure (J kg-1 K-1)
References
based on equation (6.1) from Maarten Ambaum (2010): Thermal Physics of the Atmosphere (pp 109).
-
pyTSEB.meteo_utils.
calc_lambda
(T_A_K)[source]¶ Calculates the latent heat of vaporization.
Parameters: T_A_K (float) – Air temperature (Kelvin). Returns: Lambda – Latent heat of vaporisation (J kg-1). Return type: float References
based on Eq. 3-1 Allen FAO98
-
pyTSEB.meteo_utils.
calc_pressure
(z)[source]¶ Calculates the barometric pressure above sea level.
Parameters: z (float) – height above sea level (m). Returns: p – air pressure (mb). Return type: float
-
pyTSEB.meteo_utils.
calc_psicr
(c_p, p, Lambda)[source]¶ Calculates the psicrometric constant.
Parameters: Returns: psicr – Psicrometric constant (mb C-1).
Return type:
-
pyTSEB.meteo_utils.
calc_rho
(p, ea, T_A_K)[source]¶ Calculates the density of air.
Parameters: Returns: rho – density of air (kg m-3).
Return type: References
based on equation (2.6) from Brutsaert (2005): Hydrology - An Introduction (pp 25).
-
pyTSEB.meteo_utils.
calc_rho_w
(T_K)[source]¶ density of air-free water ata pressure of 101.325kPa :param T_K: :return: density of water (kg m-3)
-
pyTSEB.meteo_utils.
calc_stephan_boltzmann
(T_K)[source]¶ Calculates the total energy radiated by a blackbody.
Parameters: T_K (float) – body temperature (Kelvin) Returns: M – Emitted radiance (W m-2) Return type: float
-
pyTSEB.meteo_utils.
calc_theta_s
(xlat, xlong, stdlng, doy, year, ftime)[source]¶ Calculates the Sun Zenith Angle (SZA).
Parameters: - xlat (float) – latitude of the site (degrees).
- xlong (float) – longitude of the site (degrees).
- stdlng (float) – central longitude of the time zone of the site (degrees).
- doy (float) – day of year of measurement (1-366).
- year (float) – year of measurement .
- ftime (float) – time of measurement (decimal hours).
Returns: theta_s – Sun Zenith Angle (degrees).
Return type: References
Adopted from Martha Anderson’s fortran code for ALEXI which in turn was based on Cupid.
-
pyTSEB.meteo_utils.
calc_sun_angles
(lat, lon, stdlon, doy, ftime)[source]¶ Calculates the Sun Zenith and Azimuth Angles (SZA & SAA).
Parameters: Returns: - sza (float) – Sun Zenith Angle (degrees).
- saa (float) – Sun Azimuth Angle (degrees).
-
pyTSEB.meteo_utils.
calc_vapor_pressure
(T_K)[source]¶ Calculate the saturation water vapour pressure.
Parameters: T_K (float) – temperature (K). Returns: ea – saturation water vapour pressure (mb). Return type: float
-
pyTSEB.meteo_utils.
calc_delta_vapor_pressure
(T_K)[source]¶ Calculate the slope of saturation water vapour pressure.
Parameters: T_K (float) – temperature (K). Returns: s – slope of the saturation water vapour pressure (kPa K-1) Return type: float
-
pyTSEB.meteo_utils.
calc_mixing_ratio
(ea, p)[source]¶ Calculate ratio of mass of water vapour to the mass of dry air (-)
Parameters: Returns: r – mixing ratio (-)
Return type: float or numpy array
-
pyTSEB.meteo_utils.
calc_lapse_rate_moist
(T_A_K, ea, p)[source]¶ Calculate moist-adiabatic lapse rate (K/m)
Parameters: Returns: Gamma_w – moist-adiabatic lapse rate (K/m)
Return type: float or numpy array