From 597e8562f45e62f8f87f08da8167aab06d85e84b Mon Sep 17 00:00:00 2001 From: Aldo Tapia Date: Mon, 18 Aug 2025 17:30:27 -0700 Subject: [PATCH 1/2] Update meteo_utils.py Added an Actual vapor pressure estimation when RH is not provided --- pyet/meteo_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyet/meteo_utils.py b/pyet/meteo_utils.py index 0e35c58..537f0a0 100644 --- a/pyet/meteo_utils.py +++ b/pyet/meteo_utils.py @@ -264,7 +264,11 @@ def calc_ea(tmean=None, tmax=None, tmin=None, rhmax=None, rhmin=None, rh=None, e es = calc_es(tmax=tmax, tmin=tmin) else: es = calc_e0(tmean) - return rh / 100 * es + if rh is None and tmin is not None: + ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 + else: + ea = rh / 100 * es + return ea def day_of_year(tindex): From 8090035afc1d5b8fcfed019088f99d9a38406099 Mon Sep 17 00:00:00 2001 From: Aldo Tapia Date: Mon, 18 Aug 2025 17:37:28 -0700 Subject: [PATCH 2/2] File black formatted --- pyet/meteo_utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyet/meteo_utils.py b/pyet/meteo_utils.py index 537f0a0..5842ea0 100644 --- a/pyet/meteo_utils.py +++ b/pyet/meteo_utils.py @@ -1,6 +1,4 @@ -"""The meteo_utils module contains utility functions for meteorological data. - -""" +"""The meteo_utils module contains utility functions for meteorological data.""" from numpy import cos, exp, isnan, log, pi, sin, tan from pandas import Series, to_numeric @@ -265,9 +263,9 @@ def calc_ea(tmean=None, tmax=None, tmin=None, rhmax=None, rhmin=None, rh=None, e else: es = calc_e0(tmean) if rh is None and tmin is not None: - ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 + ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 else: - ea = rh / 100 * es + ea = rh / 100 * es return ea