From 1e5eba2da524e258345eb9796819200ee7052f8e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 11 Jan 2020 22:54:01 +0100 Subject: Fix west / east order --- fancy_local_sunrise.py | 3 ++- local_sunrise.py | 2 +- sun.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fancy_local_sunrise.py b/fancy_local_sunrise.py index a206c25..49302bd 100644 --- a/fancy_local_sunrise.py +++ b/fancy_local_sunrise.py @@ -76,11 +76,12 @@ for time in np.arange(*time_range): ax_polar = fig.add_axes([0.0, 0.0, 1.0, 1.0], projection='polar', label='Overlay') ax_polar.patch.set_alpha(0) ax_polar.set_theta_zero_location('N') + ax_polar.set_theta_direction(-1) ax_polar.set_rlim(bottom=90, top=0) yticks = [0, 15, 30, 45, 60, 75, 90] ax_polar.set_yticks(yticks) ax_polar.set_yticklabels(['' if i == 90 else '%d°' % i for i in yticks], color='white', fontsize=6) - ax_polar.set_rlabel_position(-90/4) + ax_polar.set_rlabel_position(90/4) ax_polar.set_xticklabels(['N', 'NW', 'W', 'SW', 'S', 'SE', 'E', 'NE']) ax_polar.grid(True) diff --git a/local_sunrise.py b/local_sunrise.py index dbc8555..7032847 100644 --- a/local_sunrise.py +++ b/local_sunrise.py @@ -12,7 +12,7 @@ from planets import earth from sun import sun_direction from datetime import datetime -fish_eye = True +fish_eye = False config = { 'size_x': 1000 if fish_eye else 1920//4, diff --git a/sun.py b/sun.py index 379ad64..7ceec5d 100644 --- a/sun.py +++ b/sun.py @@ -27,6 +27,6 @@ def sun_direction(lat, lon, time, time_diff, summertime_shift = 0): azimuth = np.arccos((np.cos(d) * np.sin(l) * np.cos(h) - np.sin(d) * np.cos(l)) / np.cos(altitude)) if h < 0: - return (altitude, -azimuth) - else: return (altitude, azimuth) + else: + return (altitude, -azimuth) -- cgit v1.2.3