# Python program to load a FITS image and display it

# import needed extensions
from numpy import *
import matplotlib.pyplot as plt # plotting package
import matplotlib.cm as cm # colormaps
import pyfits


# read in the file
# change input.fits to the name of your file
h = pyfits.open('testpattern1.fit')

# copy the image data into a numpy (numerical python) array
img = h[0].data

# plot the image on the screen
plt.ion() # do plots in interactive mode    
colmap = plt.get_cmap('gray') # load gray colormap
plt.imshow(img, cmap=colmap) # plot image using gray colorbar
plt.show() # display the image

# print out the header information in the file
# print h[0].header

