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.

sample.fits header
NAXIS = 2
NAXIS1 = 150
NAXIS2 = 150

Please let me know if any other information is needed. Any help is appreciated.

Thanks.

New contributor
cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

cat is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.