You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PySolar seems to produce discontinuous sun elevation/altitude around sunset (and also near sunrise): there is a ~0.6deg jump in the following test case. May be related to #115.
Minimal example showing the issue:
import pysolar.solar as solar
import datetime
import matplotlib.pyplot as plt
import numpy as np
lat, long = 37.249870621332086, -115.81458511013524 # a randomly picked position
strange_timestamp = 1565491275.92175
epsilon = 420 #3600*12 #0.00008 # <- scale
x = np.linspace(strange_timestamp - epsilon, strange_timestamp + epsilon, 100)
y = [solar.get_altitude(lat, long, datetime.datetime.fromtimestamp(t).astimezone(datetime.timezone.utc)) for t in x]
plt.scatter(x, y, label='pysolar')
# optional, for comparison (pip install pysolar suncalc)
import suncalc
y2 = [np.rad2deg(suncalc.get_position(datetime.datetime.fromtimestamp(t).astimezone(datetime.timezone.utc), long, lat)['altitude']) for t in x]
plt.scatter(x, y2, label='suncalc')
plt.legend()
plt.show()
The text was updated successfully, but these errors were encountered:
PySolar seems to produce discontinuous sun elevation/altitude around sunset (and also near sunrise): there is a ~0.6deg jump in the following test case. May be related to #115.
Minimal example showing the issue:
The text was updated successfully, but these errors were encountered: