-
-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Labels
Milestone
Description
In spacetelescope/specviz#471 an issue came up that at it's core is about a spectrum being "out of order" - that is, some of the other specutils machinery assumes the spectral_axis
is strictly ordered.
While it's of course possible to fix the associated specutils machinery, it's almost certain that user-written analysis tools might make this assumption. So what is to be done? Here are the options I see:
- Have a warning be issued when a
Spectrum1D
is created and the inputs are out-of-order (both the array and the wcs case, probably by just checkingspectral_axis
). This warning would basically just say "this might work for some things... but be aware here there be dragons because it's tricky to get this right". - Raise an exception if the input is a
Quantity
spectral_axis
, saying "you should sort your spectral_axis" (and a warning for wcs, which is impossible to fix-up) - Forcibly re-order the inputs
- Do nothing in code, but document clearly what the expectation is - i.e., should user code assume in-order or not?