Skip to content
This repository

Scientific-grade astronomy routines for Python

branch: master
Octocat-spinner-32 bin Rebuilt the city() geographic database using Google Maps to correct o… November 30, 2010
Octocat-spinner-32 data Rebuilt the city() geographic database using Google Maps to correct o… November 30, 2010
Octocat-spinner-32 extensions Fix #35 by accepting Unicode literals in Python 2 April 16, 2014
Octocat-spinner-32 generate Renamed ".long" to ".lon" after realizing how "longitude" is syllabif… January 04, 2011
Octocat-spinner-32 issues Add graph of satellite involved in #38 April 16, 2014
Octocat-spinner-32 libastro-3.7.5 Fix #14: make earthsat.ra and dec be epoch-of-date March 01, 2013
Octocat-spinner-32 src Bump version to December 21, 2013
Octocat-spinner-32 .gitignore Ignore IPython checkpoints April 16, 2014
Octocat-spinner-32 .travis.yml Pull 2.5 out of Travis; they no longer support it December 21, 2013
Octocat-spinner-32 COPYING Following feedback from two additional source code authors, modified the March 04, 2009
Octocat-spinner-32 INSTALL Abandoned "setuptools" in favor of plain "distutils"; now use "unitte… February 09, 2011
Octocat-spinner-32 LICENSE-GPL Rewrote the PyEphem license to the LGPL, after getting permission September 11, 2007
Octocat-spinner-32 LICENSE-LGPL Rewrote the PyEphem license to the LGPL, after getting permission September 11, 2007
Octocat-spinner-32 Add README.rst to the source distribution March 01, 2013
Octocat-spinner-32 Makefile Removed old Makefile rules for building documentation (now we use Sph… June 12, 2008
Octocat-spinner-32 README.rst Add a Gittip widget atop the README December 21, 2013
Octocat-spinner-32 TODO Make a version number explicit in TODO file December 21, 2013
Octocat-spinner-32 Adapt to change README -> README.rst January 26, 2013
Octocat-spinner-32 tox.ini Add "tox.ini" and get tests running vs 2.6, 2.7 November 22, 2012


This version of PyEphem, named pyephem in the Python Package Index, is the version for the Python 2.x series. If you have gone ahead and transitioned to Python 3.0, then look for the package named ephem instead.

PyEphem provides an ephem Python package for performing high-precision astronomy computations. The underlying numeric routines are coded in C and are the same ones that drive the popular XEphem astronomy application, whose author, Elwood Charles Downey, generously gave permission for their use in PyEphem. The name ephem is short for the word ephemeris, which is the traditional term for a table giving the position of a planet, asteroid, or comet for a series of dates.

The PyEphem web site offers documentation and also links to the project bug tracker, user support forum, and source code repository.

The design of PyEphem emphasizes convenience and ease of use. Both celestial bodies and the observer's location on Earth are represented by Python objects, while dates and angles automatically print themselves in standard astronomical formats:

>>> import ephem
>>> mars = ephem.Mars()
>>> mars.compute('2008/1/1')
>>> print mars.ra, mars.dec
5:59:27.35 26:56:27.4

The documentation includes both a Quick Reference and a Tutorial, which are included in text files within the module itself as well as being available on the PyEphem web site.

The features provided by PyEphem include:

  • Find where a planet, comet, or asteroid is in the sky.
    • High-precision orbital routines are provdied for the Moon, Sun, planets, and the major planet moons.
    • The user can supply the orbital elements of a comet, asteroid, or Earth-orbiting satellite, and have its location computed.
    • The positions of 94 bright stars come built-in, and the user can create further fixed objects as needed for their calculations.
  • Determine where in the sky an object appears for a particular observer.
    • The user can supply the longitude, latitude, and altitude of the location from which they will be observing.
    • For convenience, a small database of longitudes and latitudes for 122 world cities is included.
    • For specified weather conditions (temperature and pressure), PyEphem will compensate for atmospheric refraction by adjusting the positions of bodies near the horizon.
  • Compute when a body will rise, transit overhead, and set from a particular location.
  • Parse and use orbital data in either the traditional XEphem file format, or the standard TLE format used for tracking Earth-orbiting satellites.
  • Determine the dates of the equinoxes and solstices.
  • Compute the dates of the various phases of the Moon.
  • Convert from the Greenwich Time (more precisely, Ephemeris Time) which PyEphem uses to the local time of the user.
  • Convert positions between the equatorial, ecliptic, and galactic coordinate systems.
  • Determine on which page of the Uranometria or the Millennium Star Atlas a particular star should appear.
  • Return the Julian Date corresponding to any calendar date.
Something went wrong with that request. Please try again.