User testing of the optional bad pixel self-calibration step has revealed a bug in how the min-combine across input rate files is done for MIRI MRS. Since the MRS dark can vary significantly, it's possible for an empty-field background image to have rates throughout the FOV that are brighter than for the corresponding science data, hence flagging science pixels as bad.
Moving the bad pixel self calibration step to after the straylight step would not solve the issue, since the straylight step only removes the pedestal from the one science image, not the selfcal images in the association.
Instead, the bad pixel selfcal step should be modified to perform the same kind of subtraction of the median rate in the empty region between MRS channels as is used by the straylight step.
Issue JP-3738 was created on JIRA by David Law:
User testing of the optional bad pixel self-calibration step has revealed a bug in how the min-combine across input rate files is done for MIRI MRS. Since the MRS dark can vary significantly, it's possible for an empty-field background image to have rates throughout the FOV that are brighter than for the corresponding science data, hence flagging science pixels as bad.
Moving the bad pixel self calibration step to after the straylight step would not solve the issue, since the straylight step only removes the pedestal from the one science image, not the selfcal images in the association.
Instead, the bad pixel selfcal step should be modified to perform the same kind of subtraction of the median rate in the empty region between MRS channels as is used by the straylight step.