I found out by accident that OUTDIR environment variable tells msbuild
where to put executables. Taking advantage of this so I can control
where generate.exe and ctest.exe end up, instead of having to search for them.
I didn't know that OUTDIR is a magic environment variable
that changes where msbuild puts executables.
That could be handy to know. In fact, maybe I should just use
that instead of searching for executables.
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.
Instead of lumping all angular errors together, tally maximum errors
separately for heliocentric vectors, geocentric vectors, horizontal
angular coordinates, and ecliptic angular coordinates.
This is to help me ensure that as I make improvements for aberration,
I don't make other things worse.
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 JS and C SkyPos functions are calculating slightly
different values. It looks like the C code is actually
a little more accurate. I want to understand why.
This is one step closer to adding a check for identical
output between the JS and C calculation checks.
I still see discrepancies that need to be resolved,
but the time values are all now identical.
Now temp/js_check.txt and temp/c_check.txt are in the exact same format.
This reveals interesting discrepancies between the two calculations
that need to be resolved. There should be very tiny differences, if any,
between the respective outputs of the C and JavaScript tests.
In fact, that should be another part of the unit test.
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.