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

WCS get_pc() not taking CROTA into account #6405

Open
astrofrog opened this issue Jul 30, 2017 · 0 comments
Open

WCS get_pc() not taking CROTA into account #6405

astrofrog opened this issue Jul 30, 2017 · 0 comments

Comments

@astrofrog
Copy link
Member

astrofrog commented Jul 30, 2017

According to the docstring of get_pc, this method should return a matrix that takes into account CROTA if present:

Returns the PC matrix in read-only form. Unlike the
~astropy.wcs.Wcsprm.pc property, this works even when the header
specifies the linear transformation matrix in one of the alternative
CDi_ja or CROTAia forms. This is useful when you want access
to the linear transformation matrix, but don't care how it was
specified in the header.

but this is not the case:

In [21]: wcs = WCS(naxis=2)

In [22]: wcs.wcs.cdelt = [1,2]

In [23]: wcs.wcs.crota = [0, 60]

In [24]: wcs.wcs.get_pc()
Out[24]: 
array([[ 1.,  0.],
       [ 0.,  1.]])

Also, to_header outputs a header without CROTA2.

cc @nden

@astrofrog astrofrog changed the title WCS get_pc() not taking CDELT/CROTA into account WCS get_pc() not taking CROTA into account Jul 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant