In [1]:
from astropy.io import fits
import scipy
from scipy import ndimage
import numpy as np
import glob
from ppxf import ppxf
import ppxf_util as util
In [8]:
directory = 'spectra/'
file = directory + 'NGC4550_SAURON.fits'
hdu = fits.open(file)
#print dir(hdu[0].header)
#print hdu[0].header.keys
#print hdu[0].data
print 'CRVAL1', hdu[0].header['CRVAL1'] # CRVAL1 is the wavelength at the reference pixel (Angstroms)
print 'CDELT1', hdu[0].header['CDELT1'] # CDELT1 is the increment for the wavelength grid (Angstroms)
print 'NAXIS1', hdu[0].header['NAXIS1'] # NAXIS1 is the number of values in the spectrum
h1 = hdu[0].header
h1['CRVAL1'] + np.array([0.,h1['CDELT1']*(h1['NAXIS1']-1)])
Out[8]:
In [9]:
plt.plot(hdu[0].data)
Out[9]:
In [ ]: