-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Some mistakes in "precessionlib.py" #1020
Comments
@reza-ghazi — The formulae in https://www.aanda.org/articles/aa/full/2003/48/aa4068/aa4068.html Look in particular at formulae 37 and 39 from that paper, and I think you will see that they agree exactly with Skyfield's code. It is interesting that you mention the comment — it used to say:
But then a contributor complained that the rotation matrices in the comment were all backwards. Here is the issue they opened: And so the comment got changed, because when I did a quick test, it did indeed look like rotation matrices worked in the direction that they claimed — was I wrong in letting them convince me, and I should not have made the change? If you can point out where that contributor made a mistake, I will be happy to reverse the change and return the comment to its original form! That way, Skyfield would again agree with the NOVAS library that the logic was adapted from, which has exactly the same comment. |
@brandon-rhodes - I've read the #972; I think the following explanation makes it clear: The definitions of the rotation matrices depend on the direction of rotation (clockwise vs. counterclockwise) and the convention (e.g., physics vs. mathematics vs. computer graphics). The definitions from Wikipedia and my earlier explanation are correct but represent different conventions. 1. Rotation Matrix DifferencesWikipedia's Definitions (resource of #972)
My Definitions
2. Key Difference: Direction of Rotation
Why This Happens
3. Which One to Use?The choice depends on our application:
4. Converting Between ConventionsIf we want to convert from one to the other:
5. Conclusion
|
For your information, I checked the resource 1 of The ESAA and found that your values for I also checked the Expressions for IAU 2000 precession quantities again, and I found that the matrix multiplication is precisely the same as I mentioned. Footnotes
|
Thank you for double-checking another resource! I am happy to learn that Skyfield's code is correct in this instance.
Thank you very much for such a full and thorough explanation! I had no idea that there were two competing rotation directions in use by different fields. To me, the traditional trigonometric interpretation of a rotation starting on the — that I would never even have imagined defining Those are exactly the matrices you suggested above, and the ones to which the NOVAS library would have been referring in the comment in (One confusion: I am not sure exactly what you mean by "aligns with the right-hand rule", so could you explain that idea a bit more? When I curl the fingers of my right hand with my thumb sticking straight up, the fingers curl counter-clockwise from the I will plan to do the following:
Once those changes have landed, will that resolve this issue? Or can you think of any other tweaks that will be necessary before closing it? |
Frankly, the best tweak is updating the current codes. However, users can also negate the angles and get the correct value. Recall that: However, a deep understanding of the underlying concepts is needed. But at least it can be a tweak. |
A slight surprise as I sat down and submitted the code: the Supplement only reverses the rotation around the |
Hello,
There are some mistakes in the$\psi_A$ and $\omega_A$ series terms. I attached the picture shot from the table on (ESAA1, page 216), highlighting the correct numbers that should be replaced with the current values in the file.
precessionlib.py
On the other hand, the Precession matrix is defined as:
But you have mentioned in the docstring that "R3(-chi_a) R1(omega_a) R3(psi_a) R1(-epsilon_0)"
Let me explain more here:
The equations describe the two precession matrices:
They are not the same, but they are closely related. Their relationship depends on the reference frames and the direction of transformation being considered.
Key Differences
Transformation Direction:
Rotational Signs:
Inverse Transformation:
Mathematical Relationship
The relationship between the two matrices is:
Where:
The inverse of a rotation matrix is equivalent to its transpose when the matrix is orthonormal (as all rotation matrices are):
Thus, the two matrices are inversely related, meaning applying one matrix followed by the other will return the original coordinates:
Physical Interpretation
Conclusion
Thank you,
Footnotes
Urban, S. E., & Seidelmann, P. K. (2013). Explanatory Supplement to the Astronomical
Almanac (3rd ed.). University Science Books. ISBN: 978-1-891389-85-6. ↩
The text was updated successfully, but these errors were encountered: