Closed londumas closed 6 years ago
The bug is present in the fit and in the ploting. It might be the cause of the lines in https://github.com/desihub/redrock/issues/85
@londumas it looks like the resolution matrix is not normalized at the edges of the cameras, and there's some ambiguity on how to normalize there. A possible protection against this would be to check where spec.R.sum(axis=1)
starts deviating from 1 and mask those bins.
@ngbusca, @sbailey, if we keep data only when spec.R.sum(axis=1)>0.99 we loose only the first two pixels and the last two. Does that seem reasonable to you ?
@londumas yes, that seems reasonable. I also confirmed on "real" extractions of pixsim data that this would only lose 1-2 pixels on each end of each spectrum. Please make sure that those are not included in the NPIXELS output.
The following plot shows the issue linked to applying the data resolution to the templates:
spec.R.dot(mx)
. You can see that at each edge of the three spectrographs, we get a sudden drop of flux. We might be mixing zeros with data, or something of the kind.Code to reproduce: