The procedure takes a stack of bias images or very weakly illuminated flat fields and uses the histogram method to calculate the system gain in ADU per photo-electron. The input images can be a multiple selection of single images, or a single fits file containing 3D image cube or multiple extensions. As well as measuring gain, the program outputs the mean signal in the images (useful for measuring clock induced charge). The image histogram is saved as a text file for later analysis using EXCEL. A fits file is also saved consisting of a bias-subtracted sum of all the input frames.
The procedure is called as follows:
The four optional parameters define the window within the image that should be used for the analysis. If omitted, the program will calculate its own window ; one that avoids the edges of the image where there may be bad pixels. Input images are selected using a dialogue. Once read in and analysed a histogram is displayed and the user is requested to click twice with the mouse to define the maximum and minimum pixel values that will be used for the gain calculation. The range of pixel values chosen should lay on the linear part of the histogram graph. The program indicates with two vertical blue lines the range that has been chosen and then fits a line (shown in green) to the enclosed data. The gain is calculated from the gradient of this line. An example histogram can be found here.
It is very important only to use bias frames or weak flat fields as inputs to this program. If the mean signal level exceeds 0.02e- then the program will underestimate the e-/ADU gain. This error will reach -2% at a mean signal of 0.05e, -4% at a signal of 0.1e and -10% at a signal of 0.2e