Ephemeris is a strange word that evokes both scientific and mystical ideas.
For millennia it has been more an astrological term than a scientific one. But it does reflect the protoscientific knowledge of the clockwork nature of the heavens — an observation that surely pre-dates any mechanical clock. It properly refers only to periodic phenomena; interestingly, irregular phenomena are termed secular. And it is from a wholly empirical stance that this post encounters it. (Unlike Keats, perhaps, my imagination is spurred by the prospect of scientific understanding.)
This fantastic tool from NASA’s Jet Propulsion Lab provides ephemerides for objects in the solar system. It uses “all known physics” to numerically integrate the positions of more than half a million asteroids, planets, moons, comets and spacecraft. It has web, telnet and email interfaces! Nowadays, we probably should credit it with having a service-oriented API, albeit one over protocols other than HTTP (the web interface appears to be stateful and not in the same vein as REST, etc.).
Yesterday I sent it the following email:
To: horizons Subject: JOB !$$SOF COMMAND= '10','199','299','399','499','599','699','799','899','999' CENTER= '500@0' MAKE_EPHEM= 'YES' TABLE_TYPE= 'VECTORS' START_TIME= '2011-02-09' STOP_TIME= '2011-02-10' STEP_SIZE= '1 d' OUT_UNITS= 'KM-S' VECT_TABLE= '2' REF_PLANE= 'ECLIPTIC' REF_SYSTEM= 'J2000' VECT_CORR= 'NONE' VEC_LABELS= 'NO' CSV_FORMAT= 'YES' OBJ_DATA= 'YES' !$$EOF
Now, most of that was written for me by the web interface. All I had to do was customise the list of commands to include the identifiers for the ten bodies I’m interested in. These are easily obtained from the web interface (or alternatively, through email; it also accepts names but numbers seem more precise). I have asked it for plain vectors (position and velocity), relative to the solar system barycentre (id 500), in units of km and s.
Within a couple of minutes I received 10 emails, each containing vital statistics and ephemeris data over the last two days for a planet. There was some manual copy-and-paste work to get the data into my program, but that could easily be automated for larger scales. Its orderliness is perspicuously demonstrated by a calculation of the planetary orbits (click to show animation):
This is the sun, the eight planets, and, for old times’ sake, Pluto, from Julian Day 2455601.5 (i.e. 9th of February), for 250 years (approximately one orbit of Pluto). I’ve not yet put much effort into graphical output, as you can see.
It is an impressive tool and I could happily let its creators rest on their laurels. But if there is still development on it, there are a couple of improvements I would benefit from: 1. the option of receiving all responses to a single request as a single email; and 2. the ability to specify a single date; my request would return data for two subsequent days, but reducing the range by one day would result in an error. This cost an exhorbitant 1000 or so unnecessary bytes of mail data. Worse than that, it aroused my programmer’s instinct for generality and tendency to pedanticism. ;-) (The “logical” approach, of course, is to generate for dates d where a ≤ d < b: in my case, the given input would yield the desired answer.)