Skip to content

Commit 13c3851

Browse files
committed
fix to pvlib/spa.py for issue pvlib#2077
1 parent cbe4cc5 commit 13c3851

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pvlib/spa.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,10 @@ def julian_day_dt(year, month, day, hour, minute, second, microsecond):
413413
frac_of_day = (microsecond / 1e6 + (second + minute * 60 + hour * 3600)
414414
) * 1.0 / (3600*24)
415415
d = day + frac_of_day
416-
jd = (int(365.25 * (year + 4716)) + int(30.6001 * (month + 1)) + d +
417-
b - 1524.5)
416+
jd = int(365.25 * (year + 4716)) + int(30.6001 * (month + 1)) + d - 1524.5
417+
if jd > 2299160.0:
418+
jd += b
419+
418420
return jd
419421

420422

0 commit comments

Comments
 (0)