Commit Graph

1683 Commits

Author SHA1 Message Date
Don Cross
999583a989 Implemented C function Search. Not yet tested. 2019-05-20 14:53:51 -04:00
Don Cross
528dad54cf Implemented C function SunPosition. Not yet tested. 2019-05-20 14:02:29 -04:00
Don Cross
d2cab3eb2b Compare C check output with JS check output. Fail if they differ significantly. 2019-05-20 12:37:29 -04:00
Don Cross
42945d08b6 Instead of searching for executables, generate them in a known location.
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.
2019-05-19 21:49:40 -04:00
Don Cross
57a4f3d694 Fixed problem with second call to build.bat.
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.
2019-05-19 21:40:36 -04:00
Don Cross
7d4047429a Fixed #38 - Run C unit tests on Windows. 2019-05-19 21:29:31 -04:00
Don Cross
2e9f2918bd JS: Replaced SkyPos with Equator function.
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.
2019-05-19 18:12:01 -04:00
Don Cross
5f5d67d8da C: Eliminated SkyPos and added Equator function to do its work.
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.
2019-05-19 17:15:19 -04:00
Don Cross
d48759bd35 Fixing SkyPos to have lower error compared with NOVAS.
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.
2019-05-19 15:54:14 -04:00
Don Cross
c5d2beb40b Break out error stats by remote body. 2019-05-19 14:04:27 -04:00
Don Cross
2007c2f673 Data check prints RMS angular errors in addition to max angular errors. 2019-05-19 12:34:28 -04:00
Don Cross
dd86ee5dfe Improved error summary output. Renamed variables to be more precise. 2019-05-19 10:13:09 -04:00
Don Cross
5294318074 Data checker now provides more detailed breakdown of angular errors.
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.
2019-05-19 09:56:38 -04:00
Don Cross
f8bb7f1faf C version: implemented heliocentric calculation of Moon's position. 2019-05-19 09:18:13 -04:00
Don Cross
7eb8691e5a C version of GeoVector now works for the Moon. 2019-05-19 08:23:32 -04:00
Don Cross
8a34da0540 Made C GeoPos consistent with JS GeoPos.
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.
2019-05-18 23:46:18 -04:00
Don Cross
b78a6ffa4c Found one discrepancy: was not using the same latitude in both tests. 2019-05-18 23:02:56 -04:00
Don Cross
f0f7db74dd Added ad-hoc tests to find discrepancy between JS and C code.
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.
2019-05-18 22:23:08 -04:00
Don Cross
82ba5efecc Made time values match between c_check and js_check.
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.
2019-05-18 21:46:36 -04:00
Don Cross
e450e702d0 Made changes to JS and C unit tests so that "check" files are diffable.
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.
2019-05-18 20:48:40 -04:00
Don Cross
bc9f3aa2ee Implemented C version of Pluto calculator.
Generate Chebyshev model for calculating Pluto's position.
2019-05-18 20:26:29 -04:00
Don Cross
f41344afd5 Pluto work in progress: implemented Chebyshev code generator.
Not ready to push -- Chebyshev calculation not done yet for Pluto.
2019-05-18 19:57:57 -04:00
Don Cross
bf2eeed105 Implemented C version of Horizon function. Fixed bug in C GeoPos.
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.
2019-05-18 18:46:08 -04:00
Don Cross
3dc4760ab2 Eliminated the 'novas' refraction formula. Not used. 2019-05-18 15:03:44 -04:00
Don Cross
86aaa241c3 Implemented C version of SkyPos, but not yet tested. 2019-05-18 14:13:46 -04:00
Don Cross
eb659f2b9b Implemented C version of GeoMoon. Speed optimization in JS code. 2019-05-17 21:42:51 -04:00
Don Cross
e747417fee I edited the wrong astronomy.c last time. Oops. 2019-05-17 18:44:45 -04:00
Don Cross
0bc8293992 Fixed bugs in C version of GeoVector.
There were a couple of bugs in the light travel time correction.
2019-05-17 18:37:34 -04:00
Don Cross
d0cc01186e Starting to validate C VSOP calculations.
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.
2019-05-17 18:24:56 -04:00
Don Cross
475cc122a9 Mostly finished with C version of VSOP calculations.
Still needs unit test.
2019-05-17 15:55:52 -04:00
Don Cross
36141c3d1e Minor changes: use LogError in code generator. 2019-05-16 21:40:05 -04:00
Don Cross
6615e3b9f8 Starting to unit test astronomy.c.
Beginnings of a unit test for the C version of Astronomy Engine.
Currently verifies that Astro_MakeTime() is working correctly.
2019-05-16 16:18:03 -04:00
Don Cross
c7074f528e Reworking code generator to handle multiple target languages.
Generating Delta T table in both JavaScript and C.
Work in progress.
2019-05-16 15:24:14 -04:00
Don Cross
72497dafc6 Renaming things so that I can have more consistent names across languages. 2019-05-16 14:14:02 -04:00
Don Cross
2a5f7e58d9 Starting to work on C/C++ version of Astronomy Engine. 2019-05-16 14:04:09 -04:00
Don Cross
fe9c0e6f74 Fixed #37 - Corrected misleading documentation in Elongation, ElongationEvent. 2019-05-14 06:14:50 -04:00
Don Cross
a2f41f99fa Added more entries to the JavaScript documentation topic index. 2019-05-13 22:02:22 -04:00
Don Cross
ae058e3647 Another attempt to diagnose jsdoc2md problems in Travis CI. 2019-05-12 16:18:06 -04:00
Don Cross
b6775dc0da Trying to figure out why Travis CI build is broken.
It is tripping up in verify_clean, saying something has changed.
But I don't know what the problem is.
Adding 'git diff' to see if that gives me any clues.
2019-05-12 15:21:08 -04:00
Don Cross
a258858821 Refactored Handlebars declarations so I don't need partial any more. 2019-05-10 08:23:34 -04:00
Don Cross
035bfa1a7c Documented the refraction parameter for Astronomy.Horizon. 2019-05-09 21:40:08 -04:00
Don Cross
296367bd63 Attempt at fixing occasional ephemeris download error in Travis CI.
I will need to wait until I see the error happen, and confirm
that the retry logic fixes it, before I mark the bug fixed.
2019-05-09 20:40:25 -04:00
Don Cross
24ffdc3432 Minor documentation rewording. 2019-05-09 20:14:26 -04:00
Don Cross
1663da0e90 @see markers include links to the things they reference. 2019-05-09 20:10:02 -04:00
Don Cross
e6ce0440d4 Eliminated index listing in Markdown documentation. 2019-05-09 20:01:15 -04:00
Don Cross
022f792801 Fixed documentation problem for class Apsis.
Need to have description text come first in the JSDoc metadata.
2019-05-09 14:45:22 -04:00
Don Cross
e5ef2a436c Added lunar apsis tests to Windows build. Fixed problem on Windows. 2019-05-08 21:45:18 -04:00
Don Cross
b960c0238f Added NextLunarApsis function. Did some performance tuning. 2019-05-08 21:28:29 -04:00
Don Cross
1ef6cb4ce5 Added lunar_apsis_test to the unit tests. Added a little more output to it. 2019-05-08 19:24:16 -04:00
Don Cross
472aa57b90 Fixed #29 - Added SearchLunarApsis to find apogee, perigee. 2019-05-08 19:16:42 -04:00