Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coord() with unit=None still returns Ra, Dec #33

Open
andresgur opened this issue Apr 4, 2023 · 0 comments
Open

Coord() with unit=None still returns Ra, Dec #33

andresgur opened this issue Apr 4, 2023 · 0 comments

Comments

@andresgur
Copy link

cube = Cube("whatever_cube.fits"); cube.wcs.coord(unit=None)

array([[-66.49549886, -66.49549888, -66.4954989 , ..., -66.49549887,
-66.49549886, -66.49549884],
[-66.4954433 , -66.49544332, -66.49544334, ..., -66.49544332,
-66.4954433 , -66.49544328],
[-66.49538775, -66.49538777, -66.49538779, ..., -66.49538776,
-66.49538774, -66.49538773],
[-66.47805442, -66.47805443, -66.47805445, ..., -66.47805443,
-66.47805441, -66.47805439], ....

The issue I believe is line 765 of coords.py which reads coord = self.pix2sky(pixcrd.reshape(2, -1).T).T and converts pixel indexes (pixcrd) to RA, DEC regardless of the unit keyword input. There should be another elif unit is not None to avoid running self.pix2sky in the case the user wants pixels as outputs. Or the first condition should be e.g. if spaxel or unit is None? The code runs correctly if the spaxel keyword is set to True, is this the desired behaviour? The functionality of this keyword is not in the documentation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant