update COADD_FIBERSTATUS to bitwise OR when all inputs are bad #2093
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the COADD_FIBERSTATUS bit propagation bug reported in #2032 .
For good targets, COADD_FIBERSTATUS is unchanged = the bitwise AND of input FIBERSTATUS.
For targets where all input spectra are bad, this PR changes COADD_FIBERSTATUS to the bitwise OR of input FIBERSTATUS values. This fixes the case in #2032 where the input spectra were all bad, but for different reasons, resulting in a bitwise OR of 0, incorrectly implying that the input FIBERSTATUS were ok. This will also result in other bad targets getting additional bits set (due to OR instead of AND).
Note that the incorrect COADD_FIBERSTATUS=0 cases had all ivar=0 anyway, which leads to ZWARN!=0 so we weren't getting incorrectly "good" redshifts for these anyway, but some analyses/bookkeeping were treating COADD_FIBERSTATUS==0 as "good hardware" so this makes it a bit more accurate.
Results in
(previously that case was incorrectly 0).
@ashleyjross @stephjuneau @akremin heads up. Comments welcome.