![]() |
![]() |
![]() |
|
This site is the PyEphem home page
Simply scroll down to find:
Installation Guide |
Download PyEphem for Windows, Linux, or as source code, directly from the Python Package Index.
PyPI PyEphem page |
Use the PyEphem tag on Stack Overflow to ask questions about the library.
BitBucket hosts our code.
|
![]() |
![]() |
|
>>> import ephem
>>> mars = ephem.Mars()
>>> mars.compute()
>>> print mars.ra, mars.dec
6:05:56.34 23:23:40.0
>>> ephem.constellation(mars)
('Gem', 'Gemini')
>>> boston = ephem.Observer()
>>> boston.lat = '42.37'
>>> boston.lon = '-71.03'
>>> mars.compute(boston)
>>> print mars.az, mars.alt
37:55:48.9 -14:23:11.8
>>> boston.next_rising(mars)
2007/10/2 02:31:51
>>> print mars.az
56:52:52.1
>>> boston.next_transit(mars)
2007/10/2 10:07:47
>>> print mars.alt
71:02:16.3
Welcome!¶PyEphem provides scientific-grade astronomical computations for the Python programming language. Given a date and location on the Earth’s surface, it can compute the positions of the Sun and Moon, of the planets and their moons, and of any asteroids, comets, or earth satellites whose orbital elements the user can provide. Additional functions are provided to compute the angular separation between two objects in the sky, to determine the constellation in which an object lies, and to find the times at which an object rises, transits, and sets on a particular day. The numerical routines that lie behind PyEphem are those from the wonderful XEphem astronomy application, whose author, Elwood Downey, generously gave permission for us to use them as the basis for PyEphem. Installation¶Version 3.7.4.1 is the most recent release of PyEphem. Consult the change log to see the new features, including an incompatible change in the way that the rising and settings functions operate! The easiest way to install PyEphem is to use the pip command, like this: $ pip install pyephem
Better yet, you can use virtualenv to create a virtual environment, and then run its pip instead of your system-wide one. Then you will avoid having to gain administrator rights on your machine before performing the installation. If instead you want to download the Windows installer or even the raw PyEphem source code, you should visit the PyEphem entry at the Python Package Index, or use the links at the top of this page. Documentation¶
| ||