The flat field is created iteratively. First the quadrant containing the object is masked in each object frame. Second an approximate flat field is created by combining the normalised and masked object frames using the clipped median at each pixel. This flat field is applied to the object frames. The second stage is repeated but applied to the masked frames to create the final flat field.
Registration is performed using common point sources in the overlap regions.
If the recipe cannot identify sufficient common objects, it matches the centroid of the central source. If this fails, the script resorts to using the telescope offsets transformed to pixels. The resampling applies non-integer shifts of origin using bilinear interpolation. There is no rotation to align the Cartesian axes with the cardinal directions. The recipe makes the mosaics by applying offsets in intensity to give the most consistent result amongst the overlapping regions.