Fix PC to CD matrix computation in HSTWCS#228
Conversation
|
|
||
|
|
||
| def test_pc2cd(): | ||
| e = np.exp(1) |
| def pc2cd(self): | ||
| if self.wcs.has_pc(): | ||
| self.wcs.cd = self.wcs.pc * self.wcs.cdelt[1] | ||
| self.wcs.cd = self.pixel_scale_matrix |
There was a problem hiding this comment.
This will work for HST files because they don't have a PC matrix. However, the example in the test generates an incorrect file because it has now a CD, a PC, and CDELT all defined.
I'm not sure offhand what the correct action here is. I need to look into how this is used and whether it should be deleted.
There was a problem hiding this comment.
the test generates an incorrect file because it has now a CD, a PC, and CDELT all defined
@nden Which test?
|
@mcara any update on this? |
|
well, no review, so I'll be bypassing protections |
|
oops, I can't bypass. So, if you mind approving this, I can merge it. |
|
Eh, I need to rethink this. This PR is correct, per se. It is not doing anything about headers and stuff - it just fixes a bad formula (or improves it). However, |
After looking at this, there is no issue here: one |
Closes #126
This PR fixes how CD matrix is computed from PC and CDELT.
Checklist for maintainers
CHANGELOG.rstwithin the relevant release section