From 48deab917733b8da968681f11def5b310bd9c78f Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Wed, 30 Aug 2023 13:26:41 +0000 Subject: [PATCH] fix tisr --- earthkit/meteo/solar/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earthkit/meteo/solar/__init__.py b/earthkit/meteo/solar/__init__.py index 2d8bc90..212bb87 100644 --- a/earthkit/meteo/solar/__init__.py +++ b/earthkit/meteo/solar/__init__.py @@ -211,8 +211,8 @@ def cos_solar_zenith_angle_integrated( def incoming_solar_radiation(date): # To be replaced with improved formula (a, b) = (165120.0, 4892416.0) - time_delta = (date - datetime.datetime(2020, 1, 1)).total_seconds() / 3600 - return np.cos(time_delta / (24 * DAYS_PER_YEAR) * 2 * np.pi) * a + b + angle = julian_day(date) / DAYS_PER_YEAR * np.pi * 2 + return np.cos(angle) * a + b def toa_incident_solar_radiation(