PyFITS: FITS files in Python

PyFITS: FITS files in PythonIn this article, we provide examples of using the python module PyFITS for working with FITS data. We first go through a brief overview of the FITS standard, and then we describe ways for accessing information in FITS files, using convenience functions defined in PyFITS. PyFITS offers facilities that provi... View More

AstroAsciiData - working with ASCII tables

Prasanth at the Comfort at 1 AU blog has posted a nice review and tutorial on the AstroAsciiData module.  ContentsIntroductionRequirementsAn ExampleConceptsWorking with data   Creating tables      Creating table from data in file      Creating empty table   Adding and manipulating data   Adding meta data   Writing to filesAn applicat... View More

User (root/sudo free) installation of Python modules.

For this tutorial I will assume user installation of new packages by building from downloaded source, ie "python setup.py install." While this tutorial also applies to user installations with the easy_install command line tool, I reserve easy_install related notes to the "Gotcha's" section at the e... View More

Installing Sherpa 4.5 standalone for X-ray analysis

This tutorial covers the steps to build a "complete" standalone installation of Sherpa which includes everything needed to do X-ray analysis. This was tested on Mac OS 10.6 with EPD Python and also includes specific issues that came up when installing on a CentOS 5.4 linux system (with no root access) using a custom-built p... View More

Getting started with python in astronomy

Taking your first steps into python can be daunting and there are a bewildering number of tutorials available if you start googling.  Here we try to single out a few of the best that can get you going and show the basic tools that are available for scientific analysis in python.Python languageOne good (though somewhat uno... View More

Basic numpy array manipulation

NumPy is a Python library for working with multidimensional arrays. The main data type is an array. An array is a set of elements, all of the same type, indexed by a vector of nonnegative integers. Arrays can be created in different ways: >>> from numpy import *>>> a = array( [ 10, 20, 30, 40... View More

Plotting in Matplotlib

Matplotlib is the preferred 2D plotting library for Python users. The following is a collection of very simple programs from Matplotlib's examples directory. For more examples you may want to check out the Matplotlib Cookbook and the official matplotlib tutorial at http://matplotlib.sf.net/tutorial.html Simple plot #!/usr/bin/e... View More