purpose: Creates a master bias from a set of bias frames.
description: Each input frame is bad pixel corrected. Then the master frame is calculated as the mean (AVMODE = 1) or median ( AVMODE = 2) of the stack of input frames. Iteratively each input frame is compared with the master frame for large deviations. If one frame differs too much it is removed from the set of input frames and a new master is produced. As soon as no frame has to be rejected the final master frame has been found. The rejection limits are given by the THRESH parameter.
The median process is modified in that way that instead of the median the mean of all values in an interval centered on the median is taken. A master frame is generated only if MIN_COUNT raw frames are remaining for the averaging process. This ensures a minimum quality of the product.
At the end, the new master frame is compared with the corresponding certified master frame from the calibration database.