how can I access the image subsample from a FITS file?
I could not tell where exactly the data is in the file! The file headers show that it's in the second header and that it is of dimension 1024*1024! But when I try to access the second header I don't get the image array, instead I get a "nonetype" file! I believe there is something wrong am doing here!
import matplotlib.pyplot as plt
from astropy.io import fits
import cv2
headerList=fits.open('AIA20100630_0000_0211.fits')
#Load table data as image data
#imgData = headerList[1].data
imgData = headerList[0].data
hdu=headerList[1]
print('shape :',hdu.shape) #shape is 1024*1024
#show image
plt.figure()
plt.imshow(imgData)
plt.show()