Skip to content

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

@andresgur

Description

@andresgur

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions