Open mpound opened 1 month ago
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
import numpy as np
x = np.arange(10)
x[0:100] = 99
print(x)
[99 99 99 99 99 99 99 99 99 99]
Should we warn?
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