Bug #1764
closedpixel counts not always proportional to the square of binning value
0%
Description
In leginon/calibrationclient.py, the calculation of dose in method pixel_totaldose_from_imagedata assumes that a pixel value should be divided by binning^2 in order to effectively "unbin" the pixel. This does not work in two cases:
1) Eagle camera through TIA: the gain of the camera appears to be different depending on the binning
2) Direct Electron: currently in de.py, we do binning in software using numextension.bin(), this is actually an average and not a sum.
Two possible solutions to think about:
1) standardize the meaning of binning in pyscope so that you always get what you expect: a sum of the pixels that you would have gotten if you did not bin. For Eagle, this means calibrating the artificial gain that is applied to the image and reversing it before returning the image. For DE, this means using a sum function instead of the bin function (which actually does average) or maybe DE12 is now capable of hardware binning and we just use that.