Skip to main content

Compute positions of the planets and stars

Project description

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. If you have a C compiler and the pip Python installer tool on your system, then installing PyEphem should be as easy as:

pip install ephem

There are also Windows installers in the downloads section below.

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)
5:59:27.35
>>> print(mars.dec)
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.

Developers

If you are interested in learning about how PyEphem works or in exploring its source code, check out this repository from GitHub. It is hosted at:

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

If you lack expertise with version control, you can instead simply download a static copy of the most recent source code using this link:

https://github.com/brandon-rhodes/pyephem/archive/master.zip

To run its source code in place, create a virtual environment, activate it, change directory to the root of the PyEphem source code, and run:

python setup.py build_ext -i

You can then run the PyEphem test suite to see whether all of its features are working correctly on your operating system and platform:

python -m unittest discover ephem

PyEphem’s documentation is organized as a standard Sphinx document project. You can build the documentation either with the Sphinx command line:

sphinx-build -b html pyephem/ephem/doc/ ./my_documentation_directory/

— or, more typically, by invoking one of the targets in the documentation’s Makefile:

make -C ephem/doc html

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ephem-4.0.0.1.tar.gz (738.3 kB view hashes)

Uploaded Source

Built Distributions

ephem-4.0.0.1-cp39-cp39-win_amd64.whl (809.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ephem-4.0.0.1-cp39-cp39-win32.whl (789.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

ephem-4.0.0.1-cp39-cp39-manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.9

ephem-4.0.0.1-cp39-cp39-manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.9

ephem-4.0.0.1-cp39-cp39-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp39-cp39-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp39-cp39-macosx_10_9_x86_64.whl (809.0 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ephem-4.0.0.1-cp38-cp38-win_amd64.whl (808.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

ephem-4.0.0.1-cp38-cp38-win32.whl (789.4 kB view hashes)

Uploaded CPython 3.8 Windows x86

ephem-4.0.0.1-cp38-cp38-manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.8

ephem-4.0.0.1-cp38-cp38-manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8

ephem-4.0.0.1-cp38-cp38-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp38-cp38-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp38-cp38-macosx_10_9_x86_64.whl (810.2 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ephem-4.0.0.1-cp37-cp37m-win_amd64.whl (808.2 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

ephem-4.0.0.1-cp37-cp37m-win32.whl (789.2 kB view hashes)

Uploaded CPython 3.7m Windows x86

ephem-4.0.0.1-cp37-cp37m-manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.7m

ephem-4.0.0.1-cp37-cp37m-manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m

ephem-4.0.0.1-cp37-cp37m-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp37-cp37m-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (809.9 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

ephem-4.0.0.1-cp36-cp36m-win_amd64.whl (808.2 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

ephem-4.0.0.1-cp36-cp36m-win32.whl (789.1 kB view hashes)

Uploaded CPython 3.6m Windows x86

ephem-4.0.0.1-cp36-cp36m-manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.6m

ephem-4.0.0.1-cp36-cp36m-manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m

ephem-4.0.0.1-cp36-cp36m-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp36-cp36m-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp36-cp36m-macosx_10_9_x86_64.whl (809.9 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

ephem-4.0.0.1-cp35-cp35m-win_amd64.whl (808.2 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

ephem-4.0.0.1-cp35-cp35m-win32.whl (789.2 kB view hashes)

Uploaded CPython 3.5m Windows x86

ephem-4.0.0.1-cp35-cp35m-manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.5m

ephem-4.0.0.1-cp35-cp35m-manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.5m

ephem-4.0.0.1-cp35-cp35m-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp35-cp35m-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp35-cp35m-macosx_10_9_x86_64.whl (809.4 kB view hashes)

Uploaded CPython 3.5m macOS 10.9+ x86-64

ephem-4.0.0.1-cp27-cp27mu-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp27-cp27mu-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp27-cp27m-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

ephem-4.0.0.1-cp27-cp27m-manylinux2010_i686.whl (1.1 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ i686

ephem-4.0.0.1-cp27-cp27m-macosx_10_9_x86_64.whl (809.4 kB view hashes)

Uploaded CPython 2.7m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page