Getting Started with Python for Astronomy

There are a lot of Astronomical Python pages out there already. Why another one? Because none of the current pages seem to do a very good job of summarizing how to get started. This page is written from the perspective of someone in the middle of the transition from IDL to Python, and still figuring out this strange new world where objects actually work right.

The Essentials

You'll need at a bare minimum

Crucial Modules

  • PyFITS for reading FITS files
  • numdisplay for controlling ds9
  • .

    More Modules

  • APLpy for making nice plots with RA and Dec labeled axes. (Bonus: includes great support for log and arcsinh stretches, better than the default matplotlib display functions!)
  • AstroLib, an effort to re-create the IDL Goddard Library in Python (sort of). This contains several sub-modules for dealing with WCS information, ASCII tables, synthetic photometry, VOTables, and more.
  • AstLib is another astronomy library, with coordinates,
  • There's a fairly extensive list of modules at the SciPy astronomy page, and an even more extensive list over at this page.

    How do I....?

    This section will eventually contain links to best practices Python code snipped for how to...