-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Refactor gwcs_from_array to provide ND GWCS in ND flux case #1211
Changes from 20 commits
334f2dc
0547b4a
babc123
429d87a
dbe74b6
bb68350
02f7c3e
2e332a7
35e991a
c3424bb
52137fb
fd52aef
4460d26
e74b2a1
368d0fe
f856f3a
4708bf5
64d1180
55cbb3e
35ea81a
afb7cb4
75aa0d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import astropy.units as u | ||
from astropy.tests.helper import assert_quantity_allclose | ||
import numpy as np | ||
import pytest | ||
|
||
from ..spectra.spectrum import Spectrum | ||
|
||
|
@@ -89,8 +90,9 @@ def test_multiplication_basic_spectra(simulated_spectra): | |
|
||
def test_add_diff_spectral_axis(simulated_spectra): | ||
|
||
# Calculate using the spectrum/nddata code | ||
spec3 = simulated_spectra.s1_um_mJy_e1 + simulated_spectra.s1_AA_mJy_e3 # noqa | ||
# We now raise an error if the spectra aren't on the same spectral axis | ||
with pytest.raises(ValueError, match="Spectral axis of both operands must match"): | ||
spec3 = simulated_spectra.s1_um_mJy_e1 + simulated_spectra.s1_AA_mJy_e3 # noqa | ||
Comment on lines
+93
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused by this - I would have thought this failed previously - i.e. the shapes did not change. So is this also an incidental improvement that comes from these changes that's not strictly about the gwcs? If so, that's good, but should be in the changelog as an API change I think (since users might encounter this as an error where they didn't before) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that this should be in the changelog too. Previously spectrum arithmetic didn't care if the spectral axis values were different, only that the shape of the arrays were the same. It now checks to see that the values actually match as well. |
||
|
||
|
||
def test_masks(simulated_spectra): | ||
|
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.
Why was this removed? Is it an incidental thing you noticed at the time (no prob if so) or a result of this change somehow?
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 don't recall, I'll double check.
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 this was due to creating the new collapsed
Spectrum
withself.spectral_axis
rather thanself.wcs
now, and is actually probably more correct than the previously printed outrepr
, which was replacingNone
values for these quantities with0
in the process of collapsing (implying information we actually don't have).