specutils
specutils copied to clipboard
Fix moment 0 calculation for spectral axis that isn't last, update spatial moment
Non-spectral axis moments now use pixel values, previously they incorrectly still used the spectral axis for dx and dispersion and then simply did the final sums over the specified axis. It still may be reasonable to just get rid of non-spectral moments as discussed in https://github.com/astropy/specutils/issues/930.
This also fixes the moment 0 calculation in the case where the spectral axis is not last.
lgtm, I just have implementation nitpicks.
I think you need to add the expected units to the docstring, though.
Alright, I addressed your comments, thanks for the further thoughts!
Test failures are known and unrelated.