I am currently working on a astronomy project, I trying to know the coordinate of each pixel in a fits file. I've tried to use astropy.wcs, this is the code that I tried.
from astropy.io import fits
from astropy import wcs
file = fits.open(r'set029\o6602g0272o.673570.ch.909087.XY14.p01.fits')
header = file[0].header
wcs.WCS(header=header, fix=True, relax=False)
But it shows an error:
astropy.wcs._wcs.SingularMatrixError: ERROR 3 in wcsset() at line 2739 of file cextern\wcslib\C\wcs.c:
Linear transformation matrix is singular.
ERROR 3 in linset() at line 734 of file cextern\wcslib\C\lin.c:
PCi_ja matrix is singular.
Is there a way to fix this error or other ways to calculate the coordinate of each pixel. Thank you.
This is the fits file's header that I'm using.