This broken the Travis CI build, and we don't ship html documentation
anyway, so there is no need to unit test it.
Skip local html doc generation if html directory does not exist.
Figured out that JPL Horizons and other sources define elongation
as the full angle between bodies, not just the ecliptic projection
of the angle. This brings my predictions within 0.6 hours of JPL.
Still not happy with some of the hour errors, up to 14 hours.
Maybe I need to search for actual angle between planet and Sun,
not just along ecliptic longitude.
Also should try generating JPL Horizons data to verify the
test data I have here.
I don't have authoritative test data for Saturn, so I'm
just comparing against its own calculations, after having
visually inspected some test cases against my old code and
Heavens Above. This is not really adequate but it's the best
I can do right now.
Now that the magnitude test is passing (Saturn not yet implemented),
I added it to the unit test suite.
I changed the order the test are run to thoroughly exercise lower
level calculations before the tests that are based on them.
That way, in case of breakage, it will hopefully be quicker
to find the culprit.
Now Uranus calculations match output of JPL Horizons closely.
I figured this out by graphing JPL Horizons data and tweaking
my phase curve formula to match.
I was able to eyeball the slope from a graph of deduced
phase curve by analyzing JPL Horizons output.
Now my Pluto magnitude values are well within agreement.
I found a paper by James L Hilton (USNO) that provides
formulas for the phase curves of Mercury and Venus that match
the JPL Horizons tool within 0.012 mag.
https://iopscience.iop.org/article/10.1086/430212
JPL Horizons data does not include ring aspect for Saturn,
so don't bother plotting the Saturn data.
I already deleted the Saturn data so it's not there anymore.
The JPL Horizons data for Saturn says at the bottom of the file
that it does not include variations due to ring aspect.
Therefore, it is not suitable for my needs.
I realized if I'm going to create regression models of planets,
it will be helpful to have known correct values of heliocentric
distance of the planet also. Will need to figure out what to do
for Saturn's rings.
Not fully validated, but I did tweak Montenbruck/Pfleger
formulas to match JPL Horizons output for 2018-04-27 02:00 UTC.
Still need to implement formulas for Moon and Saturn.
"Phase angle" means the angle between the Sun and the Earth
as seen by a third body.
This function calculates the angle between the Sun and a body
as seen by the Earth, with a range that goes all the way to
360 degrees, allowing finding all 4 quarters of the Moon's cycle.
When searching for oppositions and conjunctions of Mercury and Mars,
dynamically adjust to their eccentric orbits by tweaking the
effective synodic period based on how far we missed the mark
on each iteration.
This brings the average for Mercury from 19 down to 6.4.
All the other planets got at least a little better.