You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The smooth spectrum does not mask the flagged channels.
Partial solution
In spectrum.py smooth:
# in core.smooth, we fill masked values with np.nan.
# astropy.convolve does not return a new mask, so we recreate
# a decimated mask where values are nan
mask = np.full(s1.shape, False)
mask[np.where(s1 == np.nan)] = True
new_data = Masked(s1 * self.flux.unit, mask)
in your example, channel 32768 was quoted. Trying to be an ignorant user, is that a typo, or do channels run from 0..32767 but we use a python range notation where the right edge doesn't count? can be so confusing.
Plus I noted that if the right edge is picked at 33000, there was no warning. I'd probably like to see a warning, this also tells the user the answer to my question about 32768
The right edge is inclusive. This is in the docs for flag_channel. However, you are right that no warning is issued for channels out of range. It just silently truncates at the spectral length. This is a feature of numpy, apparently
I'd preserve the numpy behavior. That has been useful for flagging from a starting channel all the way to the end channel without having to know where to stop (just set the end point of the range to a number of channels above the maximum allowed by the spectrometer).
Describe the bug
With the new implementation of flagging PR#412, smoothing needs to be updated to handle masks.
How to Reproduce
The smooth spectrum does not mask the flagged channels.
Partial solution
In spectrum.py smooth:
In spectrum.core.smooth:
This fixes spectrum.smooth, but then getps(smoothref=...) fails pytest.
Environment
The text was updated successfully, but these errors were encountered: