-
-
Notifications
You must be signed in to change notification settings - Fork 133
Update WCS when shifting spectrum and fix bugs with arithmetic and redshift #1287
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1287 +/- ##
=======================================
Coverage 86.94% 86.95%
=======================================
Files 63 63
Lines 4873 4891 +18
=======================================
+ Hits 4237 4253 +16
- Misses 636 638 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Test failures are unrelated timeouts. |
07cc017 to
8e472c4
Compare
8e472c4 to
b96dc77
Compare
More min version updates More oldestdeps update More pinning...
3b21bf5 to
f5ab161
Compare
|
@keflavich I added the comment you suggested, and also improved test coverage and addressed a couple problems that revealed (mainly that I forgot to update CDELT and that PCx_x will only be there for multidimensional spectra). |
cshanahan1
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.
looks reasonable to me
Fixes #1268, and additionally improves the behavior of the
shift_spectrum_tomethod.Previously, the spectral axis was updated when applying a redshift with
shift_spectrum_to, but the original WCS was kept on theSpectrum, which led to some annoying behavior and workarounds (and was potentially confusing to the user). Now the WCS will be updated along with the spectral axis - in the case of a FITS WCS, the relevant header values will be updated in place, while a GWCS will be replaced with a new lookup table GWCS. In the latter case, the original WCS will be stored in an_original_wcsattribute so no information is lost (e.g., spatial coordinates for a cube). This obviously isn't an ideal solution for the GWCS case but I hope it suffices while I investigate better ways to handle the GWCS case.