5.5 Description of Modules in the 2-Dimensional Coadder Pipeline

This pipeline consists of only one module, COADD2D, and is considered an ensemble pipeline, because multiple input bcd.fits files are combined. The pipeline selects all BCDs of the same exposure (EXPID) within an AORKEY, to form the list of files to be combined.

5.5.1 COADD2D

The module COADD2D (“2-Dimensional Coadder”) computes the asymmetric trim mean of several input files bcd.fits, whose names are listed in the text file inputlist-coadd. Other inputs to the module are the corresponding uncertainty files func.fits and BCD masks bmask.fits, respectively listed in the text files inputlist_unc_coadd, and inputlist_bmask_coadd.

The “asymmetric trim mean” algorithm is carried out for each pixel, independently of other pixels. Asymmetric trimming consists of successively discarding pixel values at the upper or lower extremes of the set that will be averaged. The algorithm details are as follows:

Denote by pix_{i} (i=1...N) the set of N pixels to be trim-averaged, where N is the number of BCDs being co-added. The asymmetric trim fraction parameter f_{asym}, also denoted as “Cut-off Fraction” (with default value 0.2) determines the maximum number N_{asym} of pixel values pix_{i} that are discarded at the extremes of the set: N_{asym} = N_{pix}f_{asym}. That is, using the default for f_{asym} up to 20% of pixel values may be discarded. The iterative process for discarding extreme pix_{i} consists of four steps:

1. Compute median(pix) of the set pix_{i}, where .

2. Determine which of the two extreme values (the highest or the lowest) of the set pix_{i} deviates more from median(pix); denote it as P_{ext}, and its absolute deviation from median(pix) as D_{ext}.

3. Excluding P_{ext}, compute the median absolute deviation D_{med} of the set pix_{i} from median(pix).

4. If D_{ext} <m_{cut}_{ }D_{med}, where the parameter m_{cut} also known as “Cut-off Multiple,” has a default value of 5.0, then terminate the iteration and compute the mean of the remaining set pix_{i}. Otherwise, discard P_{ext} from the set pix_{i}; if fewer than N_{asym} pixels have been discarded through these iterations, go back to step 1 and continue. Else, if N_{asym} pixels have been discarded from the set, terminate the iteration and compute the mean of the remaining set.

In the main output of the module, coa2d.fits, pixels are set to NaN whenever there are no non-NaN values in the trimmed set pix_{i}. Equivalently, output NaN values result whenever all pixels in the trimmed set are fatally masked in their respective bmask.fits or pmask.fits files. The inter-order regions are NaN in coa2d.fits.

The output uncertainties in c2unc.fits are the sum in quadrature of the input uncertainties in func.fits for the trimmed set, divided by the number of pixels in the trimmed set. Weights are not used in this procedure.

The output mask file c2msk.fits has bits # 12 and 13 set whenever there are no values in the trimmed set pix_{i}_{ }that are not NaN. Bit # 7 is set for pixels tagged in the input bmask.fits as “questionable flatfield applied.”