Commit Graph

58 Commits

Author SHA1 Message Date
Don Cross
bdc84e6d15 Python: _iau2000 is a little faster.
riseset test now runs in 20.3 seconds.
Converted all _iaudata to explicit float, and use tuples instead of lists.
Both appear to help.
2019-07-04 19:33:41 -04:00
Don Cross
ba244cdb0d Now running riseset test in 22 seconds: better _iau2000 loop. 2019-07-04 19:08:21 -04:00
Don Cross
0909aeeddd Python: small performance improvement in _iau2000b. 2019-07-04 15:32:15 -04:00
Don Cross
59f23226b6 Python _CalcMoon: Combine complex multiplication lists into single statements. 2019-07-04 09:52:13 -04:00
Don Cross
42a7e1680e Python _CalcMoon: Simplified ADDN, but no real performance change. 2019-07-04 09:38:28 -04:00
Don Cross
f9bdda49e3 Python _CalcMoon optimization: use native Python complex numbers. 2019-07-04 09:32:17 -04:00
Don Cross
cdc7416996 Eliminated AddThe function calls in expanded output. 2019-07-03 22:12:58 -04:00
Don Cross
0ac3fa708f fixaddsol: Major performance improvement: 29.1 seconds.
Use dictionaries instead of creating custom array classes.
That way co[] and si[] subscripts are much faster.
2019-07-03 21:46:18 -04:00
Don Cross
835d6e524b fixaddsol: Eliminate Term and AddSol functions completely. 44.4 seconds. 2019-07-03 21:34:26 -04:00
Don Cross
ca658e2ad1 fixaddsol: Eliminate lines where we are multiplying a term by zero. 2019-07-03 21:27:26 -04:00
Don Cross
19eee58f00 Python: fixaddsol now greatly reduces the number of calls to AddThe(). 46.6 seconds. 2019-07-03 20:57:45 -04:00
Don Cross
ea10e1c793 Python: fixaddsol.py now generates smaller optimized code. 48.7 seconds. 2019-07-03 20:45:43 -04:00
Don Cross
00c2543c7b Python: AddSol translation gets time down to 49 seconds. 2019-07-03 20:36:20 -04:00
Don Cross
810724a7da Python: Another _CalcMoon performance improvement.
Reworked Term() to use less array indexing; pack and unpack tuples instead.
Execution time for riseset is just below 51 seconds now.
2019-07-03 19:54:10 -04:00
Don Cross
adc424106c Python: Improved performance of _CalcMoon.
I unrolled the loop in the Term function.
The riseset test now runs in 52 seconds instead of 56.
2019-07-03 17:49:42 -04:00
Don Cross
9359b80c42 Fixed #46 - Python calculations exactly match C calculations.
The problem was that the Python "%" operator does not behave
exactly like the C function fmod().  However, there is a Python
function math.fmod() that does act just like its counterpart in C.
Now astro_check output is *identical* between Python and C,
at least on my Windows 10 laptop.

Reinstated "ctest diff" in unit tests to make sure the
two implementations stay in sync.
2019-07-02 19:19:36 -04:00
Don Cross
eb2a8c14d0 Python: finished all unit tests -- LunarApsis was the last one. 2019-07-02 14:13:31 -04:00
Don Cross
d794908472 Python: Added test and fixes for SearchPeakMagnitude. 2019-07-02 13:38:55 -04:00
Don Cross
d5bdb420b1 Simplified NextLunarApsis functions in C and Python. 2019-07-02 13:05:54 -04:00
Don Cross
d01c4fd0a5 Python: Added tests for astronomy.Illumination().
I still need to add a test for SearchPeakMagnitude().
2019-07-01 17:00:28 -04:00
Don Cross
86674e3c73 Python: implemented rise/set tests and fixed associated bugs. 2019-06-30 18:58:04 -04:00
Don Cross
e3759ebde5 Python: finished elongation/longitude tests. 2019-06-30 14:29:25 -04:00
Don Cross
4be7b949f6 JS: renamed field from apsisType to kind. 2019-06-30 07:50:29 -04:00
Don Cross
0ab44ede69 Python: Added MoonPhase test. Fixed errors. 2019-06-29 23:43:38 -04:00
Don Cross
9d304850df Python: Added seasons test and fixed errors uncovered by it. 2019-06-29 23:02:27 -04:00
Don Cross
16aa0b3313 Python: Finished first pass of porting functions.
The next step is to write all the unit tests.
2019-06-29 20:30:52 -04:00
Don Cross
a80e63b85f Python work in progress: SearchRiseSet 2019-06-29 19:43:25 -04:00
Don Cross
f36d91024d Python work in progress: SearchHourAngle. 2019-06-29 16:52:00 -04:00
Don Cross
b82f4af407 Python work in progress: SearchMoonQuarter, NextMoonQuarter. 2019-06-29 16:25:39 -04:00
Don Cross
c864dab19d Python work in progress: SearchPeakMagnitude. 2019-06-29 16:05:59 -04:00
Don Cross
2aa487aa6d Python: work in progress - magnitude functions. 2019-06-29 15:28:41 -04:00
Don Cross
52d77e34ed Python: more work in progress, translating functions.
Also fixed incorrect comment in C code.
2019-06-29 14:31:37 -04:00
Don Cross
90e526b75f Python: more work in progress, translating functions. 2019-06-29 14:12:57 -04:00
Don Cross
ba06afd817 Python work in progress: translating more functions. 2019-06-29 08:06:49 -04:00
Don Cross
8615a2548a Huge performance boost to Python code: re-use e_tilt calculations.
Calculate _e_tilt() no more than once per Time instance.
Cache the value in the Time instance and re-use it.
This reduced astro_check time from 5.0 minutes to 2.0 minutes.
2019-06-27 14:54:49 -04:00
Don Cross
c611b50d3f Significant performance boost to Python code: eliminate _ter2cel().
There were 3 calls to _ter2cel(), each of which redundantly
called _sidereal_time, which results in 3 calculations of _e_tilt().
Reworked so there is only one call to _e_tilt().

Minor changes to support using cProfile, which is how I found this.
2019-06-27 14:22:59 -04:00
Don Cross
f85025da31 Implemented astro_check in Python. Exercises major parts of the code.
There is still a slight discrepancy in calculations of altitude,azimuth
that is larger than between JS and C.
2019-06-26 21:12:27 -04:00
Don Cross
221ea1130a Implemented Python Search function. Slight tweaks to C and JS versions. 2019-06-26 17:36:29 -04:00
Don Cross
f3efb29846 Python: Implemented quadratic interpolation, to be used by Search. 2019-06-26 17:06:14 -04:00
Don Cross
5802739e66 Python: implemented function GeoVector. 2019-06-26 07:28:51 -04:00
Don Cross
d2346051e3 Python: Implemented HelioVector function. 2019-06-26 06:05:24 -04:00
Don Cross
03c1bf3c8b Python: Implemented VSOP and Chebyshev calculations. 2019-06-26 05:51:55 -04:00
Don Cross
07ba91ed65 Use same code generator for JavaScript and Python: Chebyshev Pluto model. 2019-06-26 05:25:09 -04:00
Don Cross
027a6af007 Adapted JS vsop code generator to work with Python code too.
Now the Python code and the JavaScript code for VSOP models
are generated by codegen.c using the same $ASTRO_LIST_VSOP macro.
Python functions for calculating from VSOP are not yet implemented.
2019-06-25 21:28:20 -04:00
Don Cross
787812287c Python: calling GeoMoon() without errors, but calculations not yet validated. 2019-06-24 15:25:28 -04:00
Don Cross
44b9d26d1d Python: CalcMoon work in progress. First pass is finished. Not yet tested. 2019-06-24 14:48:08 -04:00
Don Cross
79df146194 More Python CalcMoon work in progress.
Also made minor optimizations to spin() function in both JS and C.
Fixed a mistake in JS and C that does not appear to have any
algorithmic consequences, but it was definitely confusing once I saw it.
2019-06-24 14:08:38 -04:00
Don Cross
e47602f46b Python: translation in progress. 2019-06-23 21:28:45 -04:00
Don Cross
7f0a369027 Python: reworked names and made Time more object-oriented. 2019-06-23 19:46:28 -04:00
Don Cross
a76b069ccc Python: added astro_time_t.Utc(). Added more testing. 2019-06-23 17:50:13 -04:00