I have FITS file in pixel coordinates. I want to basically read in its latitude and longitude.
I know we can use something following:
from astropy import WCS
from astropy.units as units
w = WCS('sample.fits')
lat, long = w.all_pix2world(90, 38, 1)
But instead of one RA(=90), DEC(=38) value inside w.all_pix2world, I want to fetch latitudes and longitudes (in Galactic coordinate system) of the entire field of sample.fits.
NAXIS = 2
NAXIS1 = 150
NAXIS2 = 150
Please let me know if any other information is needed. Any help is appreciated.