# Path: skyfield/api.py
# N = E = +1.0
# S = W = -1.0
# 
# Path: skyfield/api.py
# N = E = +1.0
# S = W = -1.0


from skyfield import api
from skyfield.api import load
maximum difference is around 10 mas.

What difference does that make for a satellite?  Let's take the ISS.
With its orbital period of 92 minutes, it sees the Earth swing in a full
circle around the sky in that amount of time.  That's 360/90 = 4 degrees
per minute (!) = 240 arcseconds per second.  At that speed, a difference
of 10 mas in the Sun's position would at most hasten or delay the moment
of sunrise for the ISS by 40 microseconds, which is far below the
accuracy of TLE position predictions and can thus be safely incurred.

"""

ts = load.timescale()
eph = load('de421.bsp')
sun = eph['sun']
earth = eph['earth']

t = ts.utc(2000, 1, range(40 * 365))
s1 = earth.at(t).observe(sun)
s2 = (sun - earth).at(t)
print('Milliarcseconds (mas) difference:', s1.separation_from(s2).mas().max())

print()
print('Does that make physical sense?')

# The Sun orbits around the Solar System barycenter which is usually
# inside the Sun's radius but occasionally a bit outside of it.  So we
# can very roughly imagine the Sun's orbit as its own circumference,
# give or take.
solar_radius_km = 696340

# Path: skyfield/api.py
# N = E = +1.0
# S = W = -1.0
# 
# Path: skyfield/api.py
# N = E = +1.0
# S = W = -1.0


# Path: design/satellite_is_sunlit.py
from skyfield import api
from skyfield.api import load

maximum difference is around 10 mas.

What difference does that make for a satellite?  Let's take the ISS.
With its orbital period of 92 minutes, it sees the Earth swing in a full
circle around the sky in that amount of time.  That's 360/90 = 4 degrees
per minute (!) = 240 arcseconds per second.  At that speed, a difference
of 10 mas in the Sun's position would at most hasten or delay the moment
of sunrise for the ISS by 40 microseconds, which is far below the
accuracy of TLE position predictions and can thus be safely incurred.

"""

ts = load.timescale()
eph = load('de421.bsp')
sun = eph['sun']
earth = eph['earth']

t = ts.utc(2000, 1, range(40 * 365))
s1 = earth.at(t).observe(sun)
s2 = (sun - earth).at(t)
print('Milliarcseconds (mas) difference:', s1.separation_from(s2).mas().max())

print()
print('Does that make physical sense?')

# The Sun orbits around the Solar System barycenter which is usually
# inside the Sun's radius but occasionally a bit outside of it.  So we
# can very roughly imagine the Sun's orbit as its own circumference,
# give or take.
solar_radius_km = 696340

distance_sun_travels_in_one_orbit = solar_radius_km * api.tau