-
-
Notifications
You must be signed in to change notification settings - Fork 19
Fix two WCS bugs #276
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
Fix two WCS bugs #276
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #276 +/- ##
=======================================
Coverage 99.39% 99.39%
=======================================
Files 64 65 +1
Lines 2309 2326 +17
=======================================
+ Hits 2295 2312 +17
Misses 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
braingram
left a comment
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.
Thanks!
cc957bf to
0c52a7e
Compare
|
I don't know what to do about these test fails. Some of the test headers we are using from astropy have some missing NAXISn keys, one in particular has NAXIS1 but not 2-4. This means that the pixel shape doesn't roundtrip, because astropy sets pixel_shape without validation when reading the header apparently, but not when we explicitly set it using the setter. Interestingly, this did not happen when we were using the private |
Hmmm... taking https://github.com/astropy/astropy/blob/main/astropy/wcs/tests/data/spectra/orion-freq-1.hdr as an example. from astropy.wcs import WCS
from astropy.utils.data import get_pkg_data_filename
fn = get_pkg_data_filename("tests/data/spectra/orion-wave-1.hdr", "astropy.wcs")
wcs = WCS(open(fn).read())
wcs.pixel_shape = wcs.pixel_shapeproduces 2 warnings and an error: Error: Based on the header what's the expectation here for |
|
I opened a PR against this PR: Let me know what you think. |
|
Thanks @braingram I did consider that option, but I wasn't sure if you wanted to yank all the spectral WCSes. We should definitely open an issue upstream about the invalid headers. What other issues should we open upstream?
|
I'm ok dropping them given their odd behavior after loading. Maybe we can re-add them in the future if they're updated.
I'm not familiar enough with astropy WCS to know what's considered an issue. |
braingram
left a comment
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.
Thanks for all your work on this.
Co-authored-by: Brett Graham <[email protected]>
|
@braingram can we merge this? |
|
No objection from me. Merge away or let me know and I'll merge it. |
In trying to polish up sunpy/ndcube#776 I found these two bugs.