Open migueldvb opened 8 years ago
I had not seen that online form before! I do not see a knob for the kind of SPK file returned. Here is what I can find about that format:
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/spk.html#Type 1: Modified Difference Arrays
Alas, it does not state how to turn the numbers into positions, but instead refers to a document:
JPL Internal Memorandum on Modified Difference Array polynomials
I cannot find a copy of it online. I wonder if the SPICE source code would include a routine we could examine in order to learn the steps? Or do we know anyone at the JPL who could share the memorandum with us? :)
I think that the SPK kernel generator form was introduce to complement the old method of requesting SPK files for minor bodies using telnet. It is very hard to find though.
I just checked that I can read the files with data type 1 generated with the webform using spiceypy that is a wrapper around the cspice library, so it should be possible to find the source code. If I can figure out something else I will add it to this ticket.
I wrote a module named spk_type01.py, and it computes position and velocity from SPK data (data type = 1) provided by JPL, through web form and/or telnet. If you wish to try it, please check the attached file. The file contains spk_type01.py, two test programs (test_type01.py, and test_type01b.py), two SPK data files (Ryugu-HC.bsp, and Ceres_Vesta.bsp), three reference data files (*.csv), and one sample output of test_type01.py. I tested them on Anaconda3, so I don't know they works on Python 2.11 or not, sorry. spk_type01.zip
I changed name of the module to 'spktype01', and uploaded to PyPI and GitHub as follows:
PyPI - https://pypi.python.org/pypi/spktype01/0.1.0 GitHub - https://github.com/whiskie14142/spktype01
Thanks — I'll take a look at it when I get the chance! (Or, of course, any of the rest of you are free to try figuring out how to hook it up to Skyfield.)
I got a mail from a man who used jplephem and spktype01. He used them to visualize the orbit of the spacecraft Juno. They work fine, it seems. http://space.stackexchange.com/a/19263/12102
I have downloaded an SPK kernel of data type 1 form JPL horizons http://ssd.jpl.nasa.gov/x/spk.html in binary and ascii format. The kernel can be loaded using jplephem.spk.SPK but I get an error when I compute the position of an object.
Is there any way to get an SPK kernel from Horizons that is supported by
jplephem
?