Closed moustakas closed 4 months ago
This bad fit is dominated by an unmasked large negative spike in the data around 8440 Angstroms, with a claimed abs(S/N) > 200, contributing ~15% to the overall sum((S/N)^2). The QSO PCA template "wins" because it fits that bogus highly significant line with negative [OIII]. The correct galaxy fit loses because it gets a big chi2 hit from not modeling that bogus line.
The "real" fix is to address this upstream so that this feature would be masked in the first place. Physicality constraints in both galaxy and QSO templates would help on the Redrock side. Another option could be to mask any wavelengths that are huge outliers from all of the template fits, and then re-fit. That would be computationally expensive, so proceed with caution...
I was focused on the ivar spectrum and didn't check for negative pixel values. Nice catch.
I wonder if Redrock shouldn't internally mask high S/N negative pixels during fitting. Negative pixel values are fine but they shouldn't have S/N>>10.
We're throwing away a perfectly good redshift here by assuming the reductions are perfect.
For the record: the extremely negative spike was coming from a bogus feature in a DARK calibration image desi_spectro_calib/0.4.0/ccd/dark-sm1-z4-20200730.fits.gz used for z4 data from 20201214 through 20201223. After that, we used a different dark image desi_spectro_dark/v2209/dark_frames/dark-sm1-z4-20201228.fits.gz which did not have the problem pixels, and more recently @Waelthus added a new dark desi_spectro_dark/v2209/dark_frames/dark-sm1-b4-20201214.fits.gz which also fixes this problem for the December 2020 data.
Masking large statistically "significant" negative values could still be valuable for Redrock and/or desispec, but this particular case is already fixed for future data runs.
Curiously, in the iron production, these feature was sometimes masked as a cosmic (despite being negative).
Potentially related ticket-- https://github.com/desihub/desispec/issues/2152#issuecomment-1879933452
Fixed by #282, although I feel that we should make the --negflux-nsig
masking the default for Jura and beyond.
To be clear: rrdesi ... --negflux-nsig 5
(5 sigma negative flux masking) is the default, i.e. that is what you get if you don't specify the option at all. You only have to specify that option if you want to change the sigma threshold to something else.
At the data systems call today I presented this oddball. Redrock ranks a QSO model as the top two fits, both at the wrong (VI) redshift, but the sharpness of the chi^2 scan at the minimum suggests that something is amiss. The GALAXY fit (shown in gray) is at the right redshift, looks like a clearly better fit, but is ranked as the third-best minimum.
To reproduce:
And then (third minimum is the correct one):