-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Fixed the determination of scale and rotation matrix from the CDij matrix #6573
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, it's nice that we can now have feature parity with the CD matrix. My ability to fully comprehend the FITS spec was clearly not up to scratch when I first implemented this.
sunpy/map/mapbase.py
Outdated
If the CDij matrix is defined but no CDELTi values are explicitly defined, | ||
effective CDELTi values are constructed from the CDij matrix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to explain how here, because as you pointed out in #6570 there's not one singular "correct" way to do this. (Which is why it didn't used to do it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want this in this PR or another one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one preferably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to documenting how .scale is calculated without CDELT metadata present in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elaborated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking until Stuart is happy
What's the reasoning for this choice? Does it make the resulting scale have some nice mathematica; properties? |
The reason to make this choice (which is the optional constraint suggested in Paper I, equation 4) is so that if the rows of the CDij matrix are orthogonal, then the rows of the PCij matrix are orthonormal. That's your best shot at getting to a matrix that is a pure rotation (or reflection), if that is possible. |
Doc fail is due to another PR that I merged that broke it. |
… matrix from the CDij matrix
… matrix from the CDij matrix
.rotation_matrix
property where the PCij matrix was not determined correctly from the CDij matrix in the case of non-square pixels..scale
property to return reasonable values when a map has a CDij matrix and no CDELTi values. The returned pixel scales are the values that are needed so that each row of the inferred PCij matrix has unity norm.