• Stars
    star
    737
  • Rank 61,490 (Top 2 %)
  • Language
    C
  • License
    Other
  • Created over 12 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scientific-grade astronomy routines for Python

PyEphem README

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

More Repositories

1

fopnp

Foundations of Python Network Programming (Apress) — scripts and examples
Python
1,356
star
2

python-patterns

Source code behind the python-patterns.guide site by Brandon Rhodes
Python
1,256
star
3

pycon-pandas-tutorial

PyCon 2015 Pandas tutorial materials
Jupyter Notebook
1,016
star
4

python-sgp4

Python version of the SGP4 satellite position library
Python
345
star
5

logging_tree

Debug Python logging problems by printing out the tree of handlers you have defined.
Python
302
star
6

Concentric-CSS

A standard order for CSS properties that starts at the outer edge of the box model and moves inward
CSS
296
star
7

homedir

My home directory dotfiles and customizations
Perl
201
star
8

python-typesetting

A Python library letting you invoke TeX-inspired typesetting algorithms
Python
156
star
9

sphinx-tutorial

Exercises for the Sphinx Tutorial that I used to present each year at PyCon
Python
154
star
10

python-adventure

Original Colossal Caves adventure game, but in Python 3
Python
148
star
11

python-jplephem

Python version of NASA DE4xx ephemerides, the basis for the Astronomical Alamanac
Python
103
star
12

unixpc-font-bdf

Convert the venerable AT&T UNIX PC font to the modern BDF bitmap format
Python
75
star
13

uncommitted

Command-line tool to find projects whose changes have not been committed to version control
Python
74
star
14

luca

Bookkeeping in Python
Python
67
star
15

scrawler

ASCII art animation library for Python
Python
64
star
16

pycon-sql-tutorial

Resources for my PyCon SQL tutorial
Python
52
star
17

python-novas

The United States Naval Observatory NOVAS astronomy library for Python
C
42
star
18

exe-from-python

Python
34
star
19

assay

Attempt to write a Python testing framework I can actually stand
Python
24
star
20

pycon2010-mighty-dictionary

Slides, dict introspection, and dict diagramming tools for my PyCon 2010 Talk “The Mighty Dictionary”
HTML
22
star
21

pyzmq-static

Script to compile a statically-linked version of the Python "zmq" package with ØMQ and libuuid (on Linux systems) built-in instead of relying on shared libraries.
C
22
star
22

dot-emacs

My self-booting .emacs.d directory, mostly for Python and JavaScript development
Emacs Lisp
18
star
23

contingent

The Contingent library for powering a build system with dynamic rules
HTML
11
star
24

gps-to-html

Static site generator that turns GPS tracks into maps and statistics
Python
7
star
25

backpacking-planner

Simple Python script to tally mileages between campgrounds and water sources
Python
7
star
26

blog

Source code for my personal blog
Jupyter Notebook
6
star
27

publicanus

Prototype small business tax calculation for Django Dash 2012
Python
6
star
28

pywinner

Set up a Windows EC2 instance to build Python packages
Python
5
star
29

personal-search-engine

Local and searchable cache of favorite tweets and bookmarked web pages
Python
4
star
30

conda-install

Install Conda packages right from your requirements.txt file
Python
3
star
31

assert_rewriter

Rewrite assert statements in Python bytecode so they support introspection
Python
3
star
32

trace-memory-access

Scripts to trace memory accesses from a program
Python
3
star
33

python-johnhancock

Sign a PDF document with a signature.png file
Python
2
star
34

twiddler-1-driver

Linux driver for original Handykey Twiddler chording keyboard
C
2
star
35

brandon-garmin

Simple Garmin apps for backcountry navigation
Monkey C
2
star
36

website-dillers-flooring

A web site for Diller's Flooring in Bluffton, Ohio
JavaScript
2
star
37

backports

2
star
38

python-spk

A library for parsing and loading SPK files
Python
2
star
39

cmr

cmr
2
star
40

pycon2010-sphinx-tutorial

Python
1
star
41

recursive-family-search

Find out when relatives reached this continent
Python
1
star
42

org-mode-invoicer

Python program to write up an invoice using org-mode
Python
1
star
43

build-butchart-map-index

Scripts to build a map index on my web site
HTML
1
star
44

talk-about-luca

Sample code for my May 2016 Clepy talk
Jupyter Notebook
1
star
45

rhodesmill.org

Personal website, for GitHub Pages
HTML
1
star