EchelleSpectrumList.remove_nans() applies masking in-place, rather than on a copy. The EchelleSpectrum.remove_nans() correctly applies masking on a copy. We need to correct the list-like operations.
Minimal working example:
fn = 'SDCH_20201202_0059.spec_a0v.fits'
spec_list = IGRINSSpectrumList.read(fn).normalize()
spec_list[0].meta['x_values']
> array([ 0, 1, 2, ..., 2045, 2046, 2047])
spec_list.remove_nans().plot() # no assignment to anywhere!
spec_list[0].meta['x_values']
> array([ 451, 452, 453, ..., 1681, 1682, 1683]) # an inplace operation has occurred! Undesired behavior!
EchelleSpectrumList.remove_nans()
applies masking in-place, rather than on a copy. TheEchelleSpectrum.remove_nans()
correctly applies masking on a copy. We need to correct the list-like operations.Minimal working example: