[JUNGFRAU] [Dark] Fix bad pixel constant from darks taken in burst mode
Compare changes
+ 1
− 1
@@ -67,7 +67,7 @@ automated_test:
Corrected JUNGFRAU data in burst mode (16 cells) was getting a mask which was as expected for the first memory cell used, but in the other 15 cells, every pixel was marked with WRONG_GAIN_VALUE
. The mask is used for the ROI reduction, which was therefore giving nan
.
The issue is in the BadPixelsDark10Hz
constants. For medium & low gains in burst mode, all but the first memory cell are marked as invalid. Then a check for the gain stage of each pixel gets nan
, because there's no data, so it thinks all pixels are in the wrong gain stage. Finally, the code added in !914 (merged) 'reflects' WRONG_GAIN_VALUE
into the high gain stage, where we do have valid data.
The solution here is to skip the processing entirely when no data is found for a memory cell. Where this is the case, I set the bad pixel constant to NO_DARK_DATA
. It also reports which cells are missing.
Run the dark notebook interactively, working with p6616 runs 272, 273 & 274 (JNGFR02) and checked the resulting constants against the existing ones from this report.
offset[..., 0]
) and the same for the first memory cell used (offset[:, :, 15]
).offset[:, :, :15, 1:]
), the offset changes from nan
to 0. I can put it back to nan if we prefer.badpx[:, :, :15, 1:]
) go from bad pixels WRONG_GAIN_VALUE | OFFSET_NOISE_EVAL_ERROR
to now NO_DARK_DATA | NOISE_OUT_OF_THRESHOLD | OFFSET_OUT_OF_THRESHOLD
, because of 0s replacing NaNs.NO_DARK_DATA | OFFSET_NOISE_EVAL_ERROR
.