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
With version 4.1.4 I think there is an endless loop happening in sunrise calculation for some particular latitude, longitude and elevation.
I share below an example:
# venv/Lib/site-packages/ephem/__init__.py --> line 490, endless loop
#
# overtake by setting: default_newton_precision = minute
import ephem
from datetime import datetime
from timezonefinder import TimezoneFinder
from pytz import timezone
ephem_obj = ephem.Sun()
latitude = 69.043
longitude = 20.851
elevation = 1009
# Create an observer object
observer = ephem.Observer()
# Set the observer's location
observer.lat = str(latitude)
observer.lon = str(longitude)
observer.elev = elevation
tf = TimezoneFinder()
tz_str = tf.timezone_at(lat=latitude, lng=longitude)
tz = timezone(tz_str)
# Set the observer's date and time in local
observer.date = datetime(2023, 5, 21, 0, 0, 0, 0, tz)
sr = observer.next_rising(ephem_obj) # Here, endless loop! *****************
sunrise = datetime(*map(int, sr.tuple()), 0, timezone('UTC'))
ss = observer.next_setting(ephem_obj)
sunset = datetime(*map(int, ss.tuple()), 0, timezone('UTC'))
Thanks in advance for your support and work.
The text was updated successfully, but these errors were encountered:
With version 4.1.4 I think there is an endless loop happening in sunrise calculation for some particular latitude, longitude and elevation.
I share below an example:
Thanks in advance for your support and work.
The text was updated successfully, but these errors were encountered: