# Frame merging

Frame merging is a technique which uses averaging to combine multiple CCD frames into one frame. In a naive implementation the mean value of corresponding pixels of source frames could be computed. However it wouldn’t work well in practice since the sky is revolving around the celestial pole throughout the night and in most cases even perfectly adjusted motorized compensation does not track the stars with sufficient precision.

Therefore, in tasks where frame merging is performed, the reduction is done in two phases. First, the original frames are reduced up to the matching step to get the information about their relative offsets. Then, the original frames are aligned to one reference frame by means of the shift transformation. The frames are divided into groups, and for each group one combined frame is made. In this way we get a set of combined frames, which are processed in the second phase. Unlike the first phase, calibration is not applied to the combined frames since the images were already calibrated in the first phase.