I have a fits file that has a bit of a strange WCS definition. In the header part of the definition is:
CTYPE1 = 'DEC--TAN'
CTYPE2 = 'RA---TAN'
This is not a common definition, but rather reversed compared to most WCS. skycoord_to_pixel() has all the information to correctly handle this abnormal WCS definition, but it does not test CTYPE (it does test CUNITcorrectly). In line 416-421 it just assumes the WCS is in (lon, lat) order.
Currently I have my code working by using 'w.all_world2pix(Dec, RA, 0)'. Note that I flipped the RA and Dec values compared to normal . I am afraid that this will fail if I use too high of an RA.
I have a fits file that has a bit of a strange WCS definition. In the header part of the definition is:
This is not a common definition, but rather reversed compared to most WCS.
skycoord_to_pixel()has all the information to correctly handle this abnormal WCS definition, but it does not testCTYPE(it does testCUNITcorrectly). In line 416-421 it just assumes the WCS is in (lon, lat) order.Currently I have my code working by using 'w.all_world2pix(Dec, RA, 0)'. Note that I flipped the RA and Dec values compared to normal . I am afraid that this will fail if I use too high of an RA.