This is a refactoring to follow suit with what I did in the C
version of the code. It improves accuracy by using different
geocentric vector calculations for j2000 and ofdate equatorial
coordinates. Allow optional aberration corrections.
SkyPos was doing 2 different calculations and mashing them together.
Created a more general Equator function that does both jobs one at a time.
Equator can enable/disable rotation to of-date coordinates (precession+nutation)
and enable/disable aberration correction.
Equatorial coordinate type astro_equatorial_t now has a status field
just like astro_vector_t, so we can report errors.
I have figured out how to make a simple correction for aberration
when calculating geocentric vectors.
To include aberration, not only do I back-date the heliocentric
position of the observed body, but I also backdate the
heliocentric position of the Earth by the same amount of time.
This works because for time periods of a few hours or less,
it is a very good approximation for the aberration angle asin(v/c).
To match NOVAS, astrometric coordinates used for J2000 return value
must exclude the aberration correction, while of-date coordinates
must include aberration.
This requires changing the parameters passed in to SkyPos.
I will have to circle back and make the same changes in the
JavaScript code.
This significantly reduces horizontal angular errors for the planets.
The algorithm for light travel correction was not consistent
between JS and C. Now the output is consistent between the two.
Still interesting that the angular error decreased when I incorrectly
backdated the Earth's position as well as the other body's.
The C version of GeoPos was returning an ante-dated time value,
not the time the caller asked about. In other words, it was
returning the time when the observed body emitted the light
the observer sees, not the time the observation was made on the
Earth, like it was supposed to. Fortunately, my unit test caught that.
Still need to implement GeoMoon and Chebyshev Pluto calculations.
Generating output file temp/c_check.txt that is compatible with
the existing verifier code I wrote for the JavaScript library.