Matt Craig, Professor of Physics and Astronomy at Minnesota State University Moorhead, has created this list of Astropy affiliated packages to help improve your experience exploring astronomy using Python. This post was inspired by Ole Moeller-Nilsson’s recent blog post on how to get started doing astronomy with open data and Python.

One of the things I both love and hate about Python is that there is almost always more than one way to get a job done. When I first switched to Python I found that really frustrating. Of the three (or four or five or six) astronomy packages, which one was “the” package to use? Or was I supposed to use the more fundamental tools, like Numpy or SciPy? Now that I’ve been using Python for a few years, I’ve come to appreciate the diversity of tools.

I was reminded of this by a recent NumFOCUS blog post about doing astronomy with Python and open data which outlined how to use several fundamental packages to do image reduction and photometry. Here I’ll give an overview of several high-level packages for doing astronomy that are Astropy affiliated packages; these are packages that follow the same coding, documentation and testing conventions as the core astropy package. The full list of affiliated packages is on the Astropy project’s website.

I’ll give a quick overview of the packages and then wrap up with some installation instructions. I’ve only mentioned each package once in the description below, even though several really cross categories.

Some good news/bad news before we start: there are almost thirty affiliated packages, and there are many very good astronomy-related packages that are not affiliated packages. The menu of interesting Python packages only seems to increase.

Optical/IR image processing


Reduced, reprojected, stacked image with overlay of sources detected by photutils (gray circles) and two catalogs from Vizier. Courtesy of ccdproc, astropscrappy, reproject, photutils, and astroquery.


More specialized, but in the same genre, is python-cpl, a python interface to recipes of the ESO data reduction pipeline.

Once you’ve calibrated your images, photutils can be used to do source detection and aperture and PSF photometry. If you need to stack those images first, try reproject which can align them for you if the images have WCS headers.

You probably want to look at all of those nice images you are working with, so up next is…

Image viewers and plotting helpers

ginga provides by a “reference” viewer and the libraries for making your own image viewer or for customizing the reference viewer. If you use IRAF you should check out imexam, which duplicates the functionality of the IRAF tool of the same name.

Coming soon to a notebook near you: ginga-based image viewer widget…


APLpy (pronounced “apple pie”) makes it easy to prepare publication-quality plots of images with lots of options for annotating them or overlaying additional information. Finally, montage-wrapper provides a python interface to the Montage image mosaic system (Montage itself is developed and maintained by IPAC and is not an affiliated package).

There are two packages for interacting with regions on the sky: