For examples, documentation, tutorials, etc, see Astropy at http://www.astropy.org
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from PIL import Image
from astropy.io import fits
from astropy.utils.data import get_pkg_data_filename
from astropy.visualization import astropy_mpl_style
# Following is an Ipython magic command that puts figures in the notebook.
%matplotlib notebook
#%matplotlib
plt.style.use(astropy_mpl_style)
# M.L. modifications of matplotlib defaults using syntax of v.2.0
# More info at http://matplotlib.org/2.0.0/users/deflt_style_changes.html
# Changes can also be put in matplotlibrc file, or effected using mpl.rcParams[]
plt.rc('figure', figsize = (6, 4.5)) # Reduces overall size of figures
plt.rc('axes', labelsize=16, titlesize=14)
plt.rc('figure', autolayout = True) # Adjusts supblot parameters for new size
hh_file = get_pkg_data_filename('tutorials/FITS-images/HorseHead.fits')
hdu_list = fits.open(hh_file)
hdu_list.info()
hh_data = hdu_list[0].data
print(type(hh_data))
print(hh_data.shape)
hdu_list.close()
plt.imshow(hh_data, cmap='gray')
plt.grid(color='w')
plt.colorbar();
version_information
is from J.R. Johansson (jrjohansson at gmail.com); see Introduction to scientific computing with Python for more information and instructions for package installation.
version_information
is installed on the linux network at Bucknell
%load_ext version_information
%version_information numpy, matplotlib, astropy, PIL