I am working with FITS files and to open a FITS file in the usual way I have to go through two commands:
hdu = fits.open('image1.fits')
data = hdu[0].data
Now I do realize that this is necessary in order to get the primary data of the FITS file from the header. But I was wondering if there was any way to convert it to a single command that would just get me the primary data of a FITS file just by mentioning the name of the file. (Or any other way to converting this two step operation into a single step operation.)