Astropy I: core functions

Astropy is a community-developed core Python package for Astronomy (with the term used in the broad sense, from Solar System work to Cosmology). The first public release (v0.2) took place on February 20th 2013, bug-fixes are released a regular intervals.

Installation instructions for the most current version and the full documentation can be found on

After this workshop you will be familiar with some parts of Astropy, a second workshop will cover the remaining functionality.

Beginners in Python should be able to follow, but please ensure that you have a functional Python distribution installed prior to the workshop.

Workshop topics

Before you proceed

Please download this this tar file and extract the content, either by clicking on the link or by executing this python code:

from astropy.extern.six.moves.urllib import request
import tarfile
url = '', mode='r|').extractall()
cd data

Then start up IPython with the --matplotlib option to enable interactive plotting and then import numpy and matplotlib:

$ ipython --matplotlib

import numpy as np
import matplotlib.pyplot as plt


This workshop is based heavily on an introduction to Astropy written by Tom Robitaille, which can be found at

Authors:Thomas Robitaille, Moritz Guenther
Copyright:2013 Moritz Guenther