Internal reflections inside the IRAC camera optics produce ghost images. Typically, these appear as spots near bright point sources. The pipeline must flag these ghosts since otherwise they will appear as real sources, which will be a considerable problem for many IRAC science programs, most notably those looking at debris disks and other circumstellar material.
The requirement for the ghost flagging module is described section III.l of the IRAC pipeline requirements document.
Module Design
Unfortunately, the location of the ghost is dependent on the location of the original image on the array. This can be solved by providing for each IRAC channel a calibration image, C, with 2 images planes. The first image plane, C_1(x,y), encodes the x location of the ghost for each pixel, and the second image plane encodes the y location.
A = input image C = calibration image F = ghost flag mask (=0 initially) if A(x,y)>threshold then F(C_1(x,y),C_2(x,y)) = 1 endifThe calibration image C will be provided by the IT, as will the threshold above which to set the flag. When the algorithm flags a ghost, it should also write to the header a keyword indicating the typical ghost strength as a percentage of the source peak flux. This will just be a number, one per array, also provided by the IT. If the ghost is off the array, then the calibration image C will contain the value -1 for that pixel, and the ghost flagger should not set any bits.
The above description is essentially a lookup table, and can be used to flag other kinds of ghosts, most notably electrical crosstalk. It might therefore be run multiple times in several contexts - once (or possibly twice) to flag optical ghosts, and once to flag electrical crosstalk. Therefore, it would be useful if the output bit which is set could be specified as a command-line parameter, thus allowing the extra flexibility to use it multiple times to set multiple bits.