Commit Graph

2227 Commits

Author SHA1 Message Date
Don Cross
c1587de28d Deleted unused variable. 2019-04-18 09:02:35 -04:00
Don Cross
2705e6669f Added handy JS function Astronomy.NextMoonQuarter.
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.
2019-04-18 08:58:40 -04:00
Don Cross
0be5745030 Adding test data for Sun and Moon rise/set times. Not used yet. 2019-04-18 08:51:44 -04:00
Don Cross
6834d4e582 Fixed #6 - Added JS functions to find moon quarters.
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.
2019-04-17 21:03:38 -04:00
Don Cross
0477a47811 Merge branch 'master' of github.com:cosinekitty/astronomy 2019-04-17 15:15:12 -04:00
Don Cross
b02069be69 Updated Windows run.bat to run the moon phase unit test. 2019-04-17 15:14:43 -04:00
Don Cross
661c1d63e9 Got rid of ugly hack in Astronomy.Ecliptic().
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.
2019-04-17 05:12:46 -04:00
Don Cross
d00e40341b Added test of ecliptic longitude formula.
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.
2019-04-17 05:03:47 -04:00
Don Cross
f39cca2931 Starting to validate ecliptic longitude calculations. 2019-04-16 21:58:40 -04:00
Don Cross
feaa97cb7a First attempt at calculating J2000 geocentric ecliptic coordinates.
Needs testing/validation. Checking in for backup.
2019-04-16 21:19:12 -04:00
Don Cross
83d852b2d1 JS CalcMoon() now uses a Time object like other high-level functions.
This will be handy if I need to use it to calculate moon phases.
Not sure yet.
2019-04-16 20:36:11 -04:00
Don Cross
61b4652a31 Added ability to regenerate target code quickly.
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.
2019-04-16 20:30:26 -04:00
Don Cross
d7e9133f2e Generate moon phase test data from US Navy online service.
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.
2019-04-16 17:51:11 -04:00
Don Cross
db6a7d3258 Curl needs -L option to follow redirects to download from GitHub. 2019-04-16 13:57:08 -04:00
Don Cross
36ed3883b3 Updated Windows batch file run.bat to download ephemeris from GitHub.
Also fixed resulting problem in curl.exe so that it follows redirects.
2019-04-16 13:55:58 -04:00
Don Cross
ee569c7ee1 Enable Travis CI on all branches. 2019-04-16 13:13:15 -04:00
Don Cross
18e09d8290 Check all return values of fread() and fseek() to make warnings go away. 2019-04-16 13:03:11 -04:00
Don Cross
907353c2bd Rolled back my change to novas.c, because it didn't eliminate warnings after all. 2019-04-16 12:49:04 -04:00
Don Cross
a3f2495b59 Hosting DE405 ephemeris file on my own GitHub account.
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.
2019-04-16 12:40:14 -04:00
Don Cross
043f8c7e86 Added Travis CI build status badge. 2019-04-16 12:39:57 -04:00
Don Cross
4a4bed0fe6 Band-aid on NOVAS source code to hush compiler warnings.
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.
2019-04-16 12:37:27 -04:00
Don Cross
2912350197 Simpler attempt at building C code from Travis CI. 2019-04-16 11:45:48 -04:00
Don Cross
1b792e1c4c Another attempt to specify gcc-7 2019-04-15 17:10:48 -04:00
Don Cross
ab4fe5fcbe Fixed mistakes in previous Travis config 2019-04-15 17:01:10 -04:00
Don Cross
562929f827 Another attempt to build my code without silly warnings. 2019-04-15 16:57:12 -04:00
Don Cross
1349ae47d4 Upgrading C/C++ compiler to get rid of silly warnings. 2019-04-15 16:46:15 -04:00
Don Cross
e38a4785c8 Attempt to build C code. 2019-04-15 16:30:33 -04:00
Don Cross
e88914e67e Total guess about how to run a script from Travis CI. 2019-04-15 15:09:25 -04:00
Don Cross
b244eeb92d Enable Travis CI on the 'travis' branch. 2019-04-15 15:06:39 -04:00
Don Cross
a1f802e0a4 Experimenting with Travis CI.
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.
2019-04-15 15:03:06 -04:00
Don Cross
ad3bec5f4b Fixed #14 - Linux and Windows JS now match.
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.
2019-04-15 13:32:12 -04:00
Don Cross
a55b8cab0f Updated Windows jplcheck.bat to match Linux jplcheck script.
Now the Windows batch file has the same final check of
the worst-case error found across all test cases.
2019-04-15 13:21:28 -04:00
Don Cross
18c293d8c0 Fixed #12 - Support dates 1700-01-01 through 2199-12-31.
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.
2019-04-15 13:10:32 -04:00
Don Cross
643c7a1b34 Added explanatory comment. No code change. 2019-04-15 11:02:52 -04:00
Don Cross
d01ac8e150 Fixed #13 - Eliminate use of Julian Dates.
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.
2019-04-15 10:47:00 -04:00
Don Cross
e87ccfc044 Eliminating JD: CalcChebyshev 2019-04-15 10:28:28 -04:00
Don Cross
3fc64bec77 Eliminating JD: iau2000b 2019-04-15 10:19:58 -04:00
Don Cross
938942c86a Eliminating JD: nutation_angles, mean_obliq, e_tilt 2019-04-15 10:15:03 -04:00
Don Cross
bcd37239bb Eliminating JD: precession() now uses TT expressed in J2000 days. 2019-04-15 10:03:34 -04:00
Don Cross
a3f899e234 Eliminating JD: fixed nutation() 2019-04-15 09:56:09 -04:00
Don Cross
fe70afa483 Eliminating JD: fixed era() 2019-04-15 09:47:37 -04:00
Don Cross
14119de894 Work in progress: eliminating Juliate Date. 2019-04-15 09:18:13 -04:00
Don Cross
0be2b72799 A couple of baby steps toward using J2000 days throughout the code. 2019-04-14 21:34:53 -04:00
Don Cross
9ad923ccfd Starting to rework to do all calculations in J2000 days instead of JD.
This should yield a few more decimal places of accuracy with
all the time calculations.
2019-04-14 20:56:49 -04:00
Don Cross
4052f0a31f jplcheck script was not exiting when a single test failed. 2019-04-14 20:55:34 -04:00
Don Cross
c5ed0a3c3d Reduced delta_t data by 19339 bytes. 2019-04-14 17:24:48 -04:00
Don Cross
36643fc47a Fixed #2 - use finer-grained delta-t values without discontinuities.
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.
2019-04-14 16:42:50 -04:00
Don Cross
8fdad8b163 Fixed #3 - Correct geocentric coordinates for light travel time.
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).
2019-04-14 12:47:16 -04:00
Don Cross
4e77f3687c jplcheck prints worst arcminute error it found. 2019-04-14 11:27:08 -04:00
Don Cross
f8050b9913 Print JPL Horizons summary with nice columns... no more zig-zag output. 2019-04-14 11:10:52 -04:00