badpix collects together pixels identified as containing no useful data, and uses this information to produce a badpix extension table to either the input raw events file or a copy thereof. Note that no alteration of the actual events extension is performed.
A very important point regarding the bad pixels is that there are essentially three separate (though not exclusive) sets of bad pixels that must be dealt with. These are (1) the bad pixels uplinked to the satellite and eliminated on-board, (2) the bad pixels identified in the CCF but not uplinked, and (3) the additional bad pixels associated with the particular observation in question. Sets (1) and (2) are contained within the CCF (and in the case of MOS, within the ODF iteself - see below), and badpix deals with these first two sets of bad pixels, though, if a file exists containing any badpix set (3) information (created using the task badpixfind), then this information is accessed in addition (if requested).
What badpix does is to create the badpix extension to the input raw events file (or to a copy thereof), and fill this with the information regarding any or all of the badpix sets (1), (2) and (3) (from the badpixfind output file).
The user will be able to specify which set(s) of bad pixels should be used to construct the badpix extension (whether just (1), just (2), just (3), or any combination of these). Once this has been decided upon, the badpix extension is constructed and appended to the input raw events file (or a copy), and filled with the relevant information.
In cases where a badpixfind file is accessed (badpix set (3)), and either or both of the CCF badpix sets (1 and/or 2), duplicity checking and purging of the badpixfind pixels is performed (see comments).
Command switches also exist to append a purely empty BADPIX table, or to append a BADPIX table containing only those pixels within the input file X/Y window (see parameters and comments).
In the case of MOS, the task accesses the uplinked (set 1) bad pixels from the actual ODF data files of the observation in question. These are then used in preference to any uplinked (set 1) bad pixels found within the CCF. Non-uplinked (set 2) MOS bad pixels are taken from the CCF.