[AstroPy] "jplephem" - first step towards pure-Python "PyEphem"

Brandon Craig Rhodes brandon at rhodesmill.org
Fri Mar 30 12:30:36 EDT 2012


I hope that this does not dreadfully duplicate anyone else's work.

I have just released five of the major JPL ephemerides as Python
packages.  As long as you have NumPy installed, you can now run a pair
of commands like:

    pip install jplephem
    pip install de423

Then you can write scripts like this:

    import de423
    from jplephem import Ephemeris

    e = Ephemeris(de423)
    jed = 2444391.5  # 1980.06.01
    print e.compute('mars', jed)

The "jplephem" package is just a first step, and its API is currently
quite primitive (it consists only of the compute() function you've just
seen).

Conversations at PyCon about "PyEphem" this year made it clear that
users would like finer-grained control over its solar system operations
than are currently possible today, since all of the actual computation
is bundled into C-language routines.  While the last decade of being a
wrapper around XEphem's "libastro" saved me a lot of work, it now seems
time - especially with PyPy poised to absorb much of the performance
penalty of doing math in Python for those who need unusual speed - for
me to think about finally re-implementing the astronomy routines in
Python for easier maintenance and better user access to internals.

This "jplephem" package is a first step towards a pure-Python
replacement for the C internals of "PyEphem".  Next, I want to add
routines that let the JPL's x/y/z coordinates be turned into more
traditional Earth-observer numbers like RA and dec.  Are there already
astronomy routines like that lying around?  I am still learning the
ecosystem that "libastro" hopes to unify!

My github repository for this "jplephem" experiment is here:

    https://github.com/brandon-rhodes/jplephem

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon



More information about the AstroPy mailing list