diff options
author | Adrian Kummerlaender | 2020-01-11 15:57:20 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2020-01-11 15:57:20 +0100 |
commit | fa18daffb246fd8f48963ebdc0f791b91c88d08e (patch) | |
tree | 772263fef752c131261be1b44751bc9b0d763608 | |
parent | b189cb5ed36764bbb8ac9614ba14a2d330e654e0 (diff) | |
download | firmament-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
-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) |