2012-02-21

telnet protocol

[I am on family-related travel this week, so although I am working, it is not at full capacity, and I hereby assert The Rules.]

I got on the screen+skype pair-code tip with Lang for a couple of hours today to debug the part of our white-dwarf-eclipse project that queries the JPL Horizons system for the GALEX ephemeris. We need to contact the ephemeris because we have to translate the ingress and egress times for the eclipses into Solar System barycentric time. Think: Eight minutes from Earth to the Sun and all, plus additional aberration because of the spacecraft. It turned out that the problem was our negotiation with the telnet port (yes, we party like it's 1983 here at Astrometry.net headquarters) at JPL. We are using the standard Python telnetlib module, which doesn't hold your hands at all. That is, it requires us to construct all the "DO", "DON'T", "WILL", and "WONT" commands by hand. If you have no idea what I am talking about, thank your lucky stars! Suffice it to say that as we were working, it was sounding like we were hacking into NORAD for some War Games.

In the end, we succeeded, and it occurs to me that a Python module that wraps the telnetlib module and talks competently to the JPL Horizons system could be very, very valuable. Should we clean that up and push it to github? I am feeling all "code releasy" these days, with the huge positive community reaction we have got for emcee.

4 comments:

  1. Does the remote service work straightforwardly for manual users from command-line telnet? If so, I've often found pexpect (a python port of TCL's expect) to be the path of least resistance for scripting things like this. I'm sure your telnetlib approach is the Right Way, although possibly not the easiest.

    In the old days I would use autoexpect to automagically generate a TCL script from my manual interaction with a service. That script could then be edited to make it work generically.

    ReplyDelete
  2. Another +1 for releasing the tool!

    ReplyDelete
  3. I am in sore need of a Python telnet library that would talk to JPL Horizons. I have to take object strings from FITS files and then look the official small body (mostly asteroids) up. If I could automate this, it would safe me a lot of time...

    ReplyDelete