Reputation: 69
import ephem
rwth = ephem.Observer()
rwth.lat = '50.8'
rwth.long = '6.1'
rwth.horizon = '-18'
rwth.next_setting(ephem.Sun())
This will result in an error
Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ephem/init.py", line 498, in next_setting return self._riset_helper(body, start, use_center, False, False) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ephem/init.py", line 470, in _riset_helper d1 = visit_antitransit() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ephem/init.py", line 418, in visit_antitransit % (body.name, d)) ephem.AlwaysUpError: 'Sun' is still above the horizon at 2017/7/3 23:39:58
However, at this location, the sun should definitely reach astronomical twilight (which -18 degrees corresponds to). Do you know what the problem is?
Upvotes: 0
Views: 615
Reputation: 89462
At that latitude at this date (very early July), the Sun never does, in fact, reach –18° altitude, because 50.8° north is too close to the Arctic Circle. On the solstice itself — around June 21 each year — the Sun is at 23.5° north, which, if we think through the consequences, means:
Even though the current date is a few days after the equinox, the Sun has not yet retreated far enough from its farthest-north latitude to begin to bring astronomical twilights to the location you are asking about. PyEphem’s answer looks correct here.
Upvotes: 1