I'm trying to train an AI algorithm to determine photometric redshifts of galaxies, and to do so I have a FITS file which contains the training data. I need to convert this FITS file into a format which can be manipulated easily in Python, specifically a numpy array. I have already tried using astropy and followed the below youtube video:
https://www.youtube.com/watch?v=goH9yXu4jWw
however, when I attempt to convert the file and then inspect the data type, it is still a FITS file and not a numpy array. If anyone can help it'd be much appreciated!
import astropy.io
from astropy.io import fits
truth_north = fits.open('dr9_pz_truth_north.fits')
data = truth_north[1].data
when I then print the data type, it gives astropy.io.fits.fitsrec.FITS_rec
I have been told that the FITS_rec class behaves as a numpy array, however it is essential that I actually convert the file to a numpy array.
NB: I have already posted this question on Physics Stack Exchange, however my question wasn't really answered.
Thank you!