I calculate the longitude of the positions where the current height of the sun is currently ~ 0.0. This is done by iterating over the latitude of latitudes, calculating the time of sunrise at (0.0, latitude) , and then calculating longitude by multiplying the time difference (fractional hours) by 15 (the number of degrees that the sun "moves" over the surface of the earth).
When calculating sunrise times from computed coordinate tuples, the lowest latitudes show a time difference of several minutes with the highest latitudes. How to explain this difference?
IN:
points=walk_the_earth()
Of:
[-66.53673944994807, -65.0] 2012-08-21 12:07:04.748893 [-67.13184367865324, -64.5] 2012-08-21 12:07:05.666852 [-67.70314011722803, -64.0] 2012-08-21 12:07:06.541521 ... [-119.24775995314121, 64.0] 2012-08-21 12:08:45.536679 [-119.93103107437491, 64.5] 2012-08-21 12:08:47.770382 [-120.64480075612664, 65.0] 2012-08-21 12:08:50.152224
(UTC time). The code works up to a second.
What is the reason for this difference?
code
import math import xephem def longitude_from_latitude(lat): """ Calculate the longitude at which Sun altitude is ~0.0. Args: lat: A float indicating the latitude to calculate longitude for. Returns: float """ now = xephem.julianday.now() meridian = xephem.Observer(now.midnight.dublin, 0.0, lat) sun = xephem.Sun.fromobserver(meridian) transit = sun.transit(-1)
source share