diff options
-rw-r--r-- | sun.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |