0
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?

1 Answers1

1

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:

  • An observer at the North Pole would see the Sun circle the sky at 23.5° above the horizon all day.
  • An observer at 90° – 23.5° = 66.5° would see the Sun spend the whole day on the horizon, making a circle along its circumference.
  • An observer would have to be at 90° – 23.5° – 18° = 48.5° latitude or even further south in order for the Sun to dip low enough for them to observe the level of darkness defined as astronomical twilight.

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.

Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
  • At this location, it seems that it becomes very dark at night, and viewing pictures of astronomical twilight I thought that it did become astronomical twilight. That is interesting – not_this_website Jul 04 '17 at 10:39
  • Actually, this isn't the reason. You can see here there is astronomical twilight https://www.timeanddate.com/sun/germany/aachen .There are two errors: end of astronomical twilight is -18 degrees, not beginning and also I should be using use_center = True – not_this_website Jul 04 '17 at 15:33
  • On the contrary, the graph at that link demonstrates my point: there is no true night at your location, it says at the level of Astronomical Twilight all night long. Check out the lower right corner: “Night: Not for this day / Total: 00:00” When you set `use_center=True`, you are giving yourself an extra half-degree leeway and so PyEphem is returning an answer. But if you check out the chart that you just linked to, it is not until July 17th that your location will, for the first time this summer, pass beyond Astronomical Twilight and into true darkness. Does that make sense of the diagram? – Brandon Rhodes Jul 04 '17 at 21:01