Skip to content

astropy.wcs.utils.skycoord_to_pixel() does not work as expected #4976

Description

@benjaminrose

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions