Commit Graph

2227 Commits

Author SHA1 Message Date
Don Cross
a8ce5191b4 Improved term sorting by adjusting "millennia" value.
I realized that I still was telling the code to assume the
time coordinate never gets more than 0.2 millennia away from J2000.
But in fact, it is getting 0.5 millennia away. Fixed that, and
immediately found a smaller model that works.

OptimizeTop:    255 terms [     41     62     71     68      9      4]
2020-07-05 14:12:36 -04:00
Don Cross
6588e21d72 TOP2013: Relaxed required accuracy to 1 arcminute; some optimizations.
Relax apparent angular error threshold from 0.4 to 1.0 arcminutes.
No longer compare TOP2013 to NOVAS while optimizing.
Use worst-case distance between Earth and Pluto:
Pluto radius from Sun, minus Earth aphelion distance.

Sample 503 points intead of 293.
Measure 2 full orbits before J2000 and 2 full orbits after J2000.

Statistics for output/8.top :
OptimizeTop:    268 terms [     34     57     72     90      9      6]
2020-07-05 13:31:43 -04:00
Don Cross
53050bf939 TOP2013: Generating Pluto data tables in astronomy.c.
Nothing uses the tables yet. Still need to add the calculation code.
2020-07-04 23:02:14 -04:00
Don Cross
d226f3c11e Make Travis CI leave output/8.top alone. 2020-07-04 20:21:10 -04:00
Don Cross
34a5d48e9c TOP2013: Froze Pluto model at 24816 bytes.
Instead of randomly searching for a good Pluto model, just use
the one I have so far. If I find a better one, I will replace it
in the Git repo.
2020-07-04 20:02:13 -04:00
Don Cross
0afc803b94 TOP2013: First draft of a random-ray search for small models. 2020-07-04 19:31:39 -04:00
Don Cross
3ce9f07c63 TOP2013: Implemented function for picking random 6D unit vectors.
Created functions for generating random unit vectors in
6-dimensional space. Will use this for trying different
directions along which to do a binary search between
truncated TOP2013 models that have acceptable error
and those which have unacceptable error. Will home in on
the smallest model that is within tolerable error.
2020-07-04 14:24:06 -04:00
Don Cross
c2785f9ae0 Updated comments that document binary search stats. 2020-07-03 23:01:58 -04:00
Don Cross
c3d1cdf465 TOP2013: Made measurements run twice as fast by recycling invariant calculations. 2020-07-03 22:59:24 -04:00
Don Cross
d3680c1f1d TOP2013: exploring how many terms I can truncate from the 6 formulas. 2020-07-03 22:13:05 -04:00
Don Cross
cb9e5e9107 TOP2013: added helper function to directly calculate rectangular coordinates.
Also optimized calculation of rotation matrix.
2020-07-03 20:37:24 -04:00
Don Cross
ac6a101607 TOP2013: Changed my mind. Will squash models by integer skip values.
Instead of calculating amplitudes and truncating based on them,
I realized when it comes right down to it, all I want to do
is truncate fewer or more terms from each formula until I find
a good compromise between size and accuracy. A term is either
included or excluded. Therefore the degree of freedom is discrete,
not continuous. There is no need to calculate a continuous value
to adjust something with only discrete options available.
2020-07-03 20:15:53 -04:00
Don Cross
f8be7797bf TOP2013: Incorporate the pruning amplitudes inside the contribution map itself.
This change allows me to automatically initialize the pruning amplitudes
to the largest possible value that won't cause any pruning.
It establishes a lower bound for pruning each of the 6 elliptical formulas.
2020-07-03 17:23:13 -04:00
Don Cross
acac092e03 TOP2013: TopSquash() never returns an error code, so made it return void. 2020-07-03 17:04:48 -04:00
Don Cross
c2eedd6e2c TOP2013: simplified data structure.
Eliminated a layer of abstraction from the data structure
for a TOP2013 model. Just represent a flat [6][13] array of series.
2020-07-03 16:59:27 -04:00
Don Cross
03cfecea39 Starting to work TOP2013 Pluto model into the build/test process.
Generating an embryonic TOP2013 Pluto model, along with the old
Chebyshev resampling model of Pluto, into the Linux and Windows
build processes.

The TOP2013 Pluto model isn't used for anything, and it isn't
optimized properly yet, but at least this helps validate my code
automatically as I go forward.
2020-07-03 15:19:21 -04:00
Don Cross
70faf02b4d TOP2013: Eliminated nseries_calc; it causes more trouble than it's worth.
It's more elegant to assume there are always 13 series,
even if many of them are empty of any terms.
The increased calculation time is negligible.
2020-07-03 14:41:46 -04:00
Don Cross
ab5df8fc5d TOP2013: Implemented "clone" and "squash" functions.
The TopCloneModel function makes a deep copy of a model,
allocating separate term arrays for the copy.

TopSquash uses a contribution map and an array of 6 amplitude thresholds
to pack down an original model into a cloned model.
2020-07-03 14:33:31 -04:00
Don Cross
e2f5d47cc9 Eliminated top_formula_t::nseries_total.
Because the series array size is fixed, there is no reason
to have an nseries_total field.
2020-07-03 12:47:45 -04:00
Don Cross
13c02dcfc9 TOP2013: Implemented "contrib map" idea.
The contrib map is an array of 6 sortable lists, one for each
elliptical formula. Each list contains a tuple (m, s, t)
where m = the magnitude of the contribution of a term,
and (s, t) are the indices of the term in the formula.
I sort the tuples in ascending order of magnitude.
This should allow me to efficiently eliminate terms from
each formula.

I will have to add an "ignore" flag for each term, because
eliminated terms will not generally be at the end of the list.
Before saving, I will need to compact the lists.
2020-07-02 22:05:12 -04:00
Don Cross
5679aace89 TOP2013: Starting to work on pruner/optimizer.
The first step is measuring the error between TOP2013 and NOVAS
over a range of time values and finding the maximum error in
worst-case parallax arcminutes as seen from the Earth.

Next I will be able to automate pruning the model to make
it as small as possible without exceeding our error tolerance.
2020-07-02 20:19:40 -04:00
Don Cross
5079896ad5 Ported validation of TOP2013 code to Windows run.bat. 2020-07-02 10:31:28 -04:00
Don Cross
9a11828265 Windows run.bat: factored out download logic as a subroutine.
Reduced the size of the Windows batch file 'run.bat' by factoring
out the logic for downloading an external file into a subroutine.
I had already done this in the Linux bash script 'run'.
2020-07-02 10:18:04 -04:00
Don Cross
3fef403834 Updated build for Windows to include TOP2013 code. 2020-07-01 22:32:06 -04:00
Don Cross
4306f09f92 More debug info about errors comparing JPL/TOP, NOVAS/TOP. 2020-07-01 22:15:52 -04:00
Don Cross
7132080e8f Compared JPL Horizons data with TOP2013. Very good fit.
This makes me think there is something wrong with how
I am calling NovasBodyPos(). I don't understand why the errors
are tiny fractions of arcminutes here, but up to 0.11 arcmin
compared to NOVAS.
2020-07-01 21:59:18 -04:00
Don Cross
1fe3bd222b Comparing TOP2013 calculations against NOVAS.
The error is larger than I expect, especially for Pluto:
0.11 arcmin max, measured heliocentrically.
2020-07-01 19:52:14 -04:00
Don Cross
61eef7531a TOP2013: Verified calculation of rectangular coordinates.
Ported the original FORTRAN code for converting elliptical
elements to ecliptic/equatorial rectangular coordinates.
Verified against the output of the original FORTRAN program.
The results include both position vectors and velocity vectors,
and all are identical to 10 places after the decimal.
2020-07-01 19:07:35 -04:00
Don Cross
85892ec0dd Simplified TOP2013 validation test.
Always validate all planets.
Removed the option to validate a single planet.
2020-07-01 16:08:25 -04:00
Don Cross
460044df83 TOP2013: calculating correct elliptical elements. 2020-07-01 15:57:36 -04:00
Don Cross
f258c27ce5 Validate TOP2013 logic as part of automatic unit tests. 2020-07-01 14:33:39 -04:00
Don Cross
2259024404 Added self-diffing to verify we generate identical TOP2013 output as we loaded. 2020-07-01 13:24:20 -04:00
Don Cross
4c7981d325 Finally regenerated binary identical TOP2013 output.
There was one place where a couple of powers of t had empty series.
This was an important thing to fix because it would have messed
up calculations.
2020-07-01 13:07:39 -04:00
Don Cross
33d5df6280 Fixed rounding problems regenerating TOP2013.dat.
When I load TOP2013.dat, I have to simulate regenerating the output
in order to find discrepancies and fix them.
This is a total hack, but it satisfies multiple goals:

1. Generate identical output as the loaded input.
2. Confirm that what we loaded is what we meant to load.
3. Allow saving modified/calculated models correctly.
2020-07-01 12:55:29 -04:00
Don Cross
8ea3fc8c5e Track line numbers in top2013 output for debugging purposes. 2020-07-01 12:08:03 -04:00
Don Cross
87da232113 Very close to generating binary identical TOP2013 file.
I want to make sure I can load and save a TOP2013 data set perfectly
before proceeding with calculation, truncation, etc.
I'm really close, but there are occasional rounding problems
writing floating point numbers back to the file in the weird
format they use.
2020-07-01 11:52:29 -04:00
Don Cross
b5c2926b54 Needed to initialize nseries_calc in each formula. 2020-06-30 22:48:37 -04:00
Don Cross
75c1a75098 First draft of loading a TOP2013 planet model. Needs more testing. 2020-06-30 22:18:58 -04:00
Don Cross
ff5ef2b3bb Starting to implement ValidateTop2013().
Adding infrastructure for loading TOP2013 models of planets
and calculating them. Will start with a unit test to verify
I'm calculating the formulas correctly.
2020-06-30 17:58:42 -04:00
Don Cross
60b69065b8 Factored out download logic into a bash function. Download TOP2013 data.
I'm starting to work on a replacement for Pluto calculations that
are not bounded in time. I'm trying the TOP2013 model that calculates
elliptic parameters of the outer planets Jupiter..Pluto.
I needed to download the 24MB file TOP2013.dat.
I already had redundant download logic for two files, and this was a third.
So I eliminated the redundancy and generalized the download logic
in the new bash function Download.
2020-06-30 14:03:27 -04:00
Don Cross
9d04a0018c Python: improved Time repr. Added Vector repr, str support. 2020-06-14 21:31:07 -04:00
Don Cross
b6c0b9cb00 Python: added str and repr support for class Observer. 2020-06-14 21:14:53 -04:00
Don Cross
c37ade5ee3 Bumped npm version to 1.1.0 - minor documentation fixes. npm_1.1.0 2020-06-14 16:55:32 -04:00
Don Cross
2f13b463f1 Fixed two documentation formatting mistakes. 2020-06-14 16:49:02 -04:00
Don Cross
e2cb68e021 Bumped npm version to 1.0.9. npm_1.0.9 2020-06-14 15:23:28 -04:00
Don Cross
100417dbe3 Fixed #52 - Finished documenting transit functions.
This completes work on eclipses and transits.
2020-06-14 15:05:01 -04:00
Don Cross
f9ef46c5cc Implemented Python version of transit search functions. 2020-06-14 14:55:52 -04:00
Don Cross
bf5a390d88 Fixed bug in Windows run.bat running new C# unit tests. 2020-06-14 13:45:56 -04:00
Don Cross
b3573c12d7 Implemented JS Transit.
Implemented JavaScript versions of the transit functions.
2020-06-14 13:38:30 -04:00
Don Cross
7fcf730839 Implemented C# Transit functions and unit test. 2020-06-13 21:10:48 -04:00