Hi Mojtaba,
First of all, just to let you know that the astropy-dev mailing list is usually used for discussions of changes to the Astropy code itself, or for administrative discussion or announcements. You might have more luck with questions like this on the Users mailing list. Check out
https://www.astropy.org/help.html for some pointers.
That said, I think the solution here is just that you want to tell Astropy to use the first two axes defined in your FITS file for the WCS. The following seems to work for me:
>>> from
astropy.io import fits
>>> from astropy.wcs import WCS
>>> f = fits.open('new-image.fits')
>>> w = WCS(f[0].header, naxis=2)
>>> w.pixel_to_world(30, 40)
<SkyCoord (FK5: equinox=2000.0): (ra, dec) in deg
(308.05685016, 70.03994458)>
Hope that helps,
John
> --
> You received this message because you are subscribed to the Google Groups "astropy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
astropy-dev...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/astropy-dev/dc1c771b-ad9c-4dd9-a8cc-da8a86cb324fn%40googlegroups.com.