I made a comment last week on DM-20090, but the updated version of this ticket branch should resolve
We were not marking bad amplifiers as `BAD`, allowing them to be used to set the interpolation. Marking them as such now prevents the bright amplifier edge issue, and setting the value to the image median keeps the image scaling reasonable.
As for the choice between interpolation and median setting, the logic to me is:
- Large contiguous areas are reset, as there is no useful information there, and values on either side of the area have little relation to what happens in between.
- Small areas (saturation spikes, bright columns) should be interpolated, as the image data on either side of the bad pixels should be similar to the expected value in the bad region.
I'll admit this is something of an ex-post facto justification for what we do, but I will add something to this effect into the comments of isrTask, so there's an explanation for the future.