rca / PySPICE

Python wrapper around the NAIF CSPICE library
http://naif.jpl.nasa.gov/naif/
BSD 3-Clause "New" or "Revised" License
38 stars 15 forks source link

tests/horizons.py demo of pulling SPK from JPL Horizons not working any more. #19

Open nealmcb opened 9 years ago

nealmcb commented 9 years ago

It seems that the telnet interface to JPL Horizons has changed a bit, so the prompts that horizons.py is looking for (via pexpect) when getting an SPK for a comet or asteroid aren't working.

Sample error message, while trying to retrieve comet 67P/Churyumov-Gerasimenko:

$ python horizons.py 900647 ('900647_pexpect.bsp', 0, ['Horizons lookup FAILED status=1, URL=,?,: \r\n \r\r\nHorizons> SPK\r\n \r\r\n>EXACT< name search [SPACE sensitive]:\r\r\n NAME = SPK;\r\r\nContinue [ =yes, n=no, ? ] : ', 'SPK retrieval not attempted', 'SPICE Body ID not attempted'])

In addition, I don't see any way to download a binary SPK any more.

A first cut at a fix is in this pull request. It now gets an ASCII transfer file (comet_pexpect.xfr) now, rather than comet_pexpect.bsp

https://github.com/drbitboy/PySPICE/pull/2

$ python horizons.py 900647 ('900647_pexpect.xfr', -1, ['Horizons lookup status=0, URL=ftp://ssd.jpl.nasa.gov/pub/ssd/wld29182.15', '### Retrieved SPK (URL=ftp://ssd.jpl.nasa.gov/pub/ssd/wld29182.15) as 900647_pexpect.xfr', '### Retrieved SPICEID -1; status=SUCCESS'])

nealmcb commented 9 years ago

Hmmm - upon looking at tests/test_horizons2plot.py and the example object used there ("C/2013 S1") I see that the existing code works for that case, and my fixhorizons branch doesn't.

So since the Horizons prompts depend on the exact names given, the first step is probably to just give a working example in the horizons.py file documentation. Hopefully we can also give guidance on which names work and which don't. Perhaps there is a simple way to describe a comet/metor naming style that works for most or all of the interesting cases.