Peter Weilbacher (based on Joris Gerssen's draft) This recipe combines several separate flat-field images into one master
flat-field file and traces the location of the slices on the CCD.
The master flat contains the combined pixel values of the raw flat
exposures, with respect to the image combination method used, normalized
to the mean flux.
The trace table contains polynomials defining the location of the slices
on the CCD.
Processing trims the raw data and records the overscan statistics,
subtracts the bias (taking account of the overscan, if --overscan is not
"none"), and optionally, the dark from each raw input image, converts
them from adu to count, scales them according to their exposure time,
and combines the exposures using input parameters.
To trace the position of the slices on the CCD, their edges are located
using a threshold method. The edge detection is repeated at given
intervals thereby tracing the central position (the mean of both edges)
and width of each slit vertically across the CCD. Deviant positions of
detections on CCD rows can be detected and excluded before fitting a
polynomial to all positions measured for one slice. The polynomial
parameters for each slice are saved in the output trace table.
Finally, the area between the now known slice edges is searched for
dark (and bright) pixels, using statistics in each row of the master
flat.