After fixing an issue in this MR: https://git.xfel.eu/detectors/pycalibration/-/merge_requests/739 . There was an expected output identified for medium and low gain BadPixelsDark constant. All pixels in both gains were marked as WRONG_GAIN_VALUE
This led to finding a potential bug in the Jungfrau middlelayer devices for taking dark runs.
This MR introduces a momentary fix for the issue of having images of 0 adc pixels. An image of 0 adc values should be related only to a trainID = 0.
While investigating some runs /gpfs/exfel/exp/SPB/202231/p900290/raw: 36, 37, 46, and 47. We found that there are trains without images. These images were not excluded by extra_data and they had a normal trainID to it.
We are thinking that the middlelayer device for taking darks is buggy.
In the meantime, until there is a clear idea what is the reason for this bug. This exclude the trains/cells which contain images of 0 values from data used to create offset, noise, and assigning WRONG_GAIN_VALUE
to badpixels.