Fixed mistake in GeoVector(SUN): we do need to correct for light-travel time.

To be consistent, when calculating the geocentric position of the Sun,
we do need to correct for light travel time just like we would for any
other object. This reduces the maximum time error for predicting transits
from 25 minutes to 11 minutes.

Also had to disable aberration when calculating moon phases
(longitude from Sun) in order to keep a good fit with test data.
This commit is contained in:
Don Cross
2020-06-13 13:45:59 -04:00
parent 882eaaa2e7
commit 4f842627da
21 changed files with 53 additions and 91 deletions

View File

@@ -3516,10 +3516,6 @@ def GeoVector(body, time, aberration):
earth = _CalcEarth(ltime)
geo = Vector(h.x-earth.x, h.y-earth.y, h.z-earth.z, time)
if body == Body.Sun:
# The Sun's heliocentric coordinates are always (0,0,0). No need to correct.
return geo
ltime2 = time.AddDays(-geo.Length() / _C_AUDAY)
dt = abs(ltime2.tt - ltime.tt)
if dt < 1.0e-9:
@@ -4038,9 +4034,9 @@ def LongitudeFromSun(body, time):
"""
if body == Body.Earth:
raise EarthNotAllowedError()
sv = GeoVector(Body.Sun, time, True)
sv = GeoVector(Body.Sun, time, False)
se = Ecliptic(sv)
bv = GeoVector(body, time, True)
bv = GeoVector(body, time, False)
be = Ecliptic(bv)
return _NormalizeLongitude(be.elon - se.elon)