Repository navigation
add a test to see if pixels in the projected plane are non-square (distorted) - #3329
Conversation
…storted) Add a function that tests a WCS to see if pixels, when projected to the projection plane, remain square or if they become non-square (distorted). Simply checking for the presence of distortion properties (`sip`, `det2im1`, etc.) is not enough to conclude whether or not pixels will look square in the projection plane - see #3112. In addition, having equal pixel scales (see, e.g., #3230) also does not guarantee that pixels will be square. This function considers that pixels will be "square" on the projection plane if: 1. all distortion properties of the WCS object (`sip`, `det2im1`, etc.) are `None`; and 2. The CD matrix corresponding to the celestial axes is orthogonal (or unitary for complex-valued CD matrices - not supported at present). If one of the above conditions is not satisfied then pixels will be non-square.
|
@astrofrog @nden @mdboom This PR introduces a new function that will perform a more complete test than what was previously done to see if a WCS is "distorted". It is still not "perfect" but pretty close to perfect. For example, if |
|
This looks good to me. 👍 to merging into 1.0. |
There was a problem hiding this comment.
Is it a relative accuracy? Or an angle in degrees?
|
👍 apart from my small comment above. |
|
@astrofrog Epsilon is the absolute deviation between the "normalized" (to scale) CD*CD.T matrix and the identity matrix. However, the key here is that CD matrix is normalized by the I think this needs to be made clear in the documentation, so I will try to fix this tonight. |
check for matrix orthogonality was simplified and, actually, corrected.
|
@astrofrog The updated documentation should better describe "re-scaling" of the CD matrix. |
1. default value for maxerr; 2. _is_cd_orthogonal now takes a numpy.ndarray instead of full WCS; 3. Correction to documentation.
|
@mdboom @astrofrog |
|
@astrofrog - yep, I'm ok with that - this isn't a huge change and indeed it was ready well before the deadline. |
|
I'll go ahead and merge it now, and I added the 1.0 label so that will remind us to backport it prior to release. |
add a test to see if pixels in the projected plane are non-square (distorted)
add a test to see if pixels in the projected plane are non-square (distorted)
Add a function that tests a WCS to see if pixels, when projected to the projection plane, remain square or if they become non-square (distorted).
Simply checking for the presence of distortion properties (
sip,det2im1, etc.) is not enough to conclude whether or not pixels will look square in the projection plane - see #3112. In addition, having equal pixel scales (see, e.g., #3230) does not guarantee that pixels will be square.This function considers that pixels will be "square" on the projection plane if:
sip,det2im1, etc.) areNone; andIf one of the above conditions is not satisfied then pixels will be non-square.