I'm using the HYG star database v3 from:
https://github.com/astronexus/HYG-Database
I compare the star constellations it reports against
what I calculate from the star RA/DEC it lists.
When I try this against all stars in the database, I
find 25 disagreements about which constellation contains
the star. Another person found 3 disagreements. See:
https://github.com/astronexus/HYG-Database/issues/21
For now, I'm testing only the stars brighter than mag 4.890,
which eliminates all the disagreements, and still gets me
over 1000 test cases.
Also, now I'm verifying ephemeris file and star database
checksums whether or not they have just been downloaded.
The idea is to catch corruption or unexpected changes
each time I run the unit test.
This unit test only exercises 8 different points.
I want to add a more thorough unit test soon, before
moving on to implementing the constellation finder in
the other supported programming languages.
Can now calculate the heliocentric Solar System Barycenter (SSB)
and Earth/Moon Barycenter (EMB).
Changes made in C, C#, JavaScript and Python:
Added new body codes SSB, EMB.
Added support for calculating both in HelioVector functions.
Verified that all calculations match NOVAS.
Verified that all calculations match each other across languages.
Because I had to tweak models to get better planet apsis predictions,
it caused slight changes in other calculations that tripped
unit test errors. These are all still within safe values, so
I relaxed the ones that failed.
Adjust VSOP models for planets to bring their prediction errors beneath
0.1 degrees of a total orbit.
ctest no longer runs tests when no command line arguments are given.
That was annoying because I kept running it by accident.
Include an extra 4 terms in the radial component of the VSOP
model for Neptune. The code automatically picks the 4 terms
that maximize the time derivative's highest possible contribution.
The VsopTruncate function had logic to remove any trailing
empty series from a coordinate formula. Now I have split
this out into a separate function called VsopTrim.
I did this because I want to experiment with re-extending
VSOP models to improve prediction of planet apsides,
so some series that are empty might become non-empty again
before being saved to disk.
Calculate an orbital angle error as a ratio of day error
divided by orbital period in days, multiplied by 360 degrees.
This is a way to normalize errors for distant planets.
Because of Sun/SSB wobble, can't use slope solver to find
Neptune apsides. Added special case logic to find them
using more of a brute force algorithm.
Unit tests now pass, but require very loose tolerances
for the outer planets.
I will have to adjust the model generator to create
more accurate heliocentric distance models for the VSOP
planets, and more accurate Chebyshev polynomials for Pluto.
This will be a judgment call to balance accuracy versus code size.
Use planet apsis test data generated by generate.c to verify
Astronomy Engine calculations. Currently this fails for Neptune
as expected. Will fix that in a future commit.
Implemented a more efficient function Astronomy_HelioDistance
for calculating heliocentric distances of the planets
Mercury through Neptune: use VSOP distance formula only.
For Moon and Pluto, fall back to calculating heliocentric
vector and then finding the length of that vector.
Added function Time.Parse to convert a UTC date/time string
into a Time object. People should not have to keep reinventing
that wheel. I will be able to simplify astro_demo_common.py.
I am working on adding aphelion/perihelion functionality
for planets. I ran into complicated behavior with the orbit
of Neptune. Its orbit is so circular, and its movement so slow,
that wobbling of the Sun around the Solar System Barycenter (SSB)
causes there to be 3 consecutive zero-slope points near the true
perihelion. I still need to resolve this.
This reveals surprising variation in the intervals.
I think for Earth, the Moon is causing enough wobble
that I might want to find the apsides for the Earth/Moon Barycenter
instead of the Earth by itself. It will be interesting to see
if this increases agreement with the test data.
Removed redundant refraction calculations from Astronomy.Horizon().
Added a unit test that InverseRefractionAngle() converges and calculates
an accurate inverse of RefractionAngle().
More work on new functions for converting orientation systems.
Changed a few classes to structs for memory allocation efficiency.
Moved stuff around in astronomy.cs so the Astronomy class comes
last. This is helpful when I want to add new functions, so I
don't have to search for the end of the class.