Factor out the key method in jplephem.spk that actually computes planet positions, then wrap this in numba for about 25 times speedup (for that method only).
Use a specialized version of convert_time_format for time format conversions that is much faster. It sacrifices about a msec of accuracy which is fine here.
Fix a bug where the input JD time for SPK was in the UTC scale instead of the required TDB scale. This ~69 sec difference reduced the accuracy of planet positions.
Fix an issue in get_planet_chandra where the orbit ephemeris values were being interpolated to the nearest neighbor instead of linearly. Given the 5 minute sampling this makes a big difference.
Overall the get_planet_barycentric function is about 10-12 times faster for scalar or small-array valued inputs.
The accuracy of Venus planet predictions was improved from about 3-4 arcsec to under 0.2 arcsec relative to JPL Horizons.
Interface impacts
Planet positions will change slightly for the better.
============================================ 195 passed, 2 skipped in 31.86s =============================================
Independent check of unit tests by Javier
- [x] OSX:
### Functional tests
<!-- Describe and document results of any functional tests, otherwise leave the text below -->
See the two new validation notebooks.
Description
This includes a few improvements / fixes:
jplephem.spk
that actually computes planet positions, then wrap this in numba for about 25 times speedup (for that method only).convert_time_format
for time format conversions that is much faster. It sacrifices about a msec of accuracy which is fine here.get_planet_chandra
where the orbit ephemeris values were being interpolated to the nearest neighbor instead of linearly. Given the 5 minute sampling this makes a big difference.Overall the
get_planet_barycentric
function is about 10-12 times faster for scalar or small-array valued inputs.The accuracy of Venus planet predictions was improved from about 3-4 arcsec to under 0.2 arcsec relative to JPL Horizons.
Interface impacts
Planet positions will change slightly for the better.
Testing
Unit tests
chandra_aca/tests/test_aca_image.py .............. [ 7%] chandra_aca/tests/test_all.py ........................ [ 19%] chandra_aca/tests/test_attitude.py ............................................................. [ 50%] chandra_aca/tests/test_dark_model.py .... [ 52%] chandra_aca/tests/test_drift.py .......................... [ 65%] chandra_aca/tests/test_maude_decom.py ............... [ 73%] chandra_aca/tests/test_planets.py ............. [ 79%] chandra_aca/tests/test_psf.py ... [ 81%] chandra_aca/tests/test_residuals.py ss... [ 83%] chandra_aca/tests/test_star_probs.py ................................ [100%]
============================================ 195 passed, 2 skipped in 31.86s =============================================