This way people don't have to figure out how to iterate
through moon quarters. Use SearchMoonQuarter to start iteration,
NextMoonQuarter to iterate through as many more as desired.
Can now search for the next new moon, first quarter,
full moon, or third quarter.
Verified against US Navy Observatory data.
Predictions are confirmed to within 2 minutes of time
for years between 1800 and 2100.
It was conceptually wrong also, because the J2000 epoch
relates to UT, not TT. In practice, there is no measurable
difference in the obliquity less than a minute apart.
Using moon phase test data, exercised the calculation of
ecliptic longitude of the Sun and Moon at indicated times.
Compared the actual difference in longitude with 90*phase degrees,
where phase is 0 for new moon, 1 for first quarter, 2 for full,
3 for third quarter. The results always agree within 1 arcminute
(just barely).
Added this to the unit test.
Will come back and add unit tests for the phase searcher once
I implement it.
Can now run "generate fast" to skip all the VSOP and Chebyshev
calculations and just regenerate the target code (currently JS only).
This is helpful for rapid development but must be used with care.
Created test data using a Windows batch file that downloads
moon phase data from the US Navy Astronomical Applications API,
then converts the resulting JSON into a flat text file.
This has every moon phase for every tenth calendar year
between 1800 and 2100.
I'm keeping the scripts for reference, but I'm checking in
the test data to the repo for repeated use in a unit test
to be created.
I kept having trouble with Travis CI timing out trying
to download the DE405 ephmeris file from its official ftp site,
so I'm mirroring it on my own GitHub account.
Hopefully this makes the download smoother.
The original code really is ignoring fread() return values.
That is not good.
But right now I just want it to build without warnings
so I patched the code to make the warnings go away.
I have no idea what I'm doing yet, but I want to start
using Travis CI to run automated unit tests with each commit
or pull request. First I will try to build the 'generate'
project without doing anything else.
The floating point constants emitted for the Pluto Chebyshev
model did not quite match between Linux and Windows.
I suspect the real problem is not the operating system
but that I'm using different versions of Node on both:
Windows: v10.15.3
Linux: v8.15.1
Now I print only 12 place after the decimal instead of 18.
This makes no difference in the unit test output,
and reduces the JS code size significantly.
Expanded the Chebyshev model for Pluto.
Resampled VSOP models to have required accuracy over wider date range.
Decreased astro_check.js sampling rate to allow tests to run faster.
Now the JavaScript code uses UT and TT values expressed
in days since 2000, instead of Julian Dates.
This makes the numeric values much smaller and thus
should yield less floating point error when time solvers
are added later.
Using historic, recent, and predicted values of TT-UT instead of
UTC leap seconds. With linear interpolation, there are no longer
discrete jumps in the calculated TT values. Hopefully, this will
make event solvers (rise, set, etc) more well-behaved.
Astronomy.GeoVector now corrects for light travel time from
the observed object. This reduced worst case angular error
from 1.16 arcmin to 0.89 arcmin (0.27 arcmin improvement).