Positions and Coordinates

(Return to the PyEphem Quick Reference.)

There are several different ways of specifying the position of an object against the background of stars and constellations, so every PyEphem “body”, whether a planet, comet, asteroid, or star, returns three sets of coordinates when you ask it to compute its position. Briefly, these are:

Actually, the third position, the“Apparent Topocentric” position, is only computed if you provide PyEphem with an Observer to work with. If you provide only a date for compute() instead, then ra and dec will have the same values as g_ra and g_dec. The Greek prefix topo- means place, and a topocentric position reveals where a body will appear in the sky when viewed from a particular place on the Earth's surface.

The names ra and dec are short for right ascension and declination, which serve as longitude and latitude for the sky, telling us where admist the stars and constellations an object appears. See any introduction to astronomy if you need to learn how they are defined; the description below describes how the three versions of right ascension and declination returned by PyEphem differ.

How the three positions differ

The easiest way to define what each kind of coordinate means is to trace how PyEphem computes a body's position, and show how it generates each of the values in turn. PyEphem performs its computations using routines from libastro, which contains the high-precision astronomy routines used in the XEphem graphical astronomy application.

Note that no precession was applied to either of the final two sets of coordinates, but only to the first. This means that only the “Astrometric” position will correspond to the lines in your star atlas. The other positions are what are called “epoch-of-date” coordinates, and are measured off of the orientation of the celestial pole and the celestial equator for the very day of the observation itself.