aboutsummaryrefslogtreecommitdiff
path: root/sun.py
diff options
context:
space:
mode:
authorAdrian Kummerlaender2020-01-11 15:57:20 +0100
committerAdrian Kummerlaender2020-01-11 15:57:20 +0100
commitfa18daffb246fd8f48963ebdc0f791b91c88d08e (patch)
tree772263fef752c131261be1b44751bc9b0d763608 /sun.py
parentb189cb5ed36764bbb8ac9614ba14a2d330e654e0 (diff)
downloadfirmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.tar
firmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.tar.gz
firmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.tar.bz2
firmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.tar.lz
firmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.tar.xz
firmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.tar.zst
firmament-fa18daffb246fd8f48963ebdc0f791b91c88d08e.zip
Fix noon-dependent sun direction sign conversion
Diffstat (limited to 'sun.py')
-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)