aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sun.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sun.py b/sun.py
index 87bc8a9..379ad64 100644
--- a/sun.py
+++ b/sun.py
@@ -26,7 +26,7 @@ def sun_direction(lat, lon, time, time_diff, summertime_shift = 0):
altitude = np.arcsin(np.cos(l) * np.cos(h) * np.cos(d) + np.sin(l) * np.sin(d))
azimuth = np.arccos((np.cos(d) * np.sin(l) * np.cos(h) - np.sin(d) * np.cos(l)) / np.cos(altitude))
- if (time.timetuple().tm_hour <= 12):
+ if h < 0:
return (altitude, -azimuth)
else:
return (altitude, azimuth)