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
Prioritize hgln_obs over crln_obs when extracting observer information from FITS headers #7188
Conversation
9597065
to
dc77499
Compare
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 👍 , just one request for a comment, and needs a bugifx changelog entry adding.
@dstansby Thanks! I've made these changes. |
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.
Some text edits, otherwise looks good to me!
If I were to be super-picky, the part of the unit test that tests the prioritization in the Map
implementation should really live under sunpy.map.tests
and not sunpy.coordinates.tests
, because the relevant code – how GenericMap
prioritizes and sanitizes the observer location – all lives in sunpy/map/mapbase.py
.
changelog/7188.bugfix.rst
Outdated
@@ -0,0 +1 @@ | |||
Ensure that when instantiating a `WCS` from a FITS Header, the observer location is set from the Stonyhurst coordinates rather than the Carrington coordinates when both are present. |
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.
Ensure that when instantiating a `WCS` from a FITS Header, the observer location is set from the Stonyhurst coordinates rather than the Carrington coordinates when both are present. | |
When directly instantiating a `~astropy.wcs.WCS` from a FITS header that contains both Stonyhurst and Carrington heliographic coordinates for the observer location, the Stonyhurst coordinates will now be prioritized. | |
This behavior is now consistent with the `~sunpy.map.Map` class, which has always prioritized Stonyhurst coordinates over Carrington coordinates. |
Going through `Map` and `WCS` seem to follow (at least slightly) different | ||
code paths, so test them both. |
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.
Going through `Map` and `WCS` seem to follow (at least slightly) different | |
code paths, so test them both. | |
`Map` creates a custom FITS header with a sanitized observer location, so | |
we need to also test a directly instantiated `WCS` object. |
Given my recent foray into seeing if it's possible to run tests for subpackages without optional dependencies installed, ideally we would not have a direct reliance on map in the coordinates tests. |
408315f
to
cc31dcb
Compare
What's code review for, if not being picky? I moved the Text edits are also implemented. |
cc31dcb
to
86d4e20
Compare
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 to me!
…ting observer information from FITS headers
Thanks, @svank! |
Fix as proposed in #7184
Thanks @ayshih for confirming this should be right!