findgain flat1 flat2 bias1 bias2
FINDGAIN uses Janesick's method for determining the gain and read noise of a CCD from a pair of dome flats and a pair of bias frames (zero length dark exposures). The task requires that the flats and biases be unprocessed and uncoadded so that the noise characteristics of the data are preserved. Note, however, that the frames may be bias subtracted if the average of many bias frames is used, and that the overscan region may be removed prior to using this task.
The section over which the statistics are computed should be chosen carefully. The frames may be displayed and perhaps blinked, and IMSTATISTICS, IMHISTOGRAM, IMPLOT, and other tasks may be used to compare the statistics of sections of various flats and biases directly.
The formulae used by the task are:
flatdif = flat1 - flat2 biasdif = bias1 - bias2 gain = ((mean(flat1) + mean(flat2)) - (mean(bias1) + mean(bias2))) / ((sigma(flatdif))**2 - (sigma(biasdif))**2 ) readnoise = gain * sigma(biasdif) / sqrt(2)
Where the gain is given in electrons per ADU and the readnoise in electrons. Pairs of each type of comparison frame are used to reduce the effects of gain variations from pixel to pixel. The derivation follows from the definition of the gain (N(e) = gain * N(ADU)) and from simple error propagation. Also note that the measured variance (sigma**2) is related to the exposure level and read-noise variance (sigma(readout)**2) as follows:
variance(e) = N(e) + variance(readout)
Where N(e) is the number of electrons (above the bias level) in a given duration exposure.
In our implementation, the mean used in the formula for the gain may actually be any of the mean, midpt (an estimate of the median), or mode as determined by the center parameter. For the midpt or mode choices only, the value of the binwidth parameter determines the bin width (in sigma) of the histogram that is used in the calculation. FINDGAIN uses the IMSTATISTICS task to compute the statistics.
To calculate the gain and readnoise within a 100x100 section:
lo> findgain flat1 flat2 bias1 bias2 section="[271:370,361:460]"
To calculate the gain and readnoise using the mode to estimate the data level for each image section:
lo> findgain.section="[271:370,361:460]" lo> findgain flat1 flat2 bias1 bias2 center=mode
To calculate the gain and readnoise from several frames and accumulate the results in a file for graphing:
lo> findgain.section = "[41:140,171:270]" lo> findgain flat1 flat2 bias1 bias2 verbose- > gain.list lo> findgain flat3 flat4 bias3 bias4 verbose- >> gain.list lo> findgain flat5 flat6 bias5 bias6 verbose- >> gain.list lo> findgain flat7 flat8 bias7 bias8 verbose- >> gain.list lo> findgain flat9 flat10 bias9 bias10 verbose- >> gain.list lo> plot pl> graph gain.list point+
It is not obvious what to do with all the other combinations of flats and biases. Note that the values in gain.list could have been averaged or fit as well.
The image headers are not checked to see if the frames have been processed.
There is no provision for finding the "best" values and their errors from several flats and biases.
findthresh, imstatistics, imhistogram, implot,