bathotpix - locate and mask out hot pixels in a BAT detector image


bathotpix infile outfile


bathotpix locates hot pixels in a BAT detector plane image. Hot pixels can be a source of noise in subsequent image processing steps, and so should usually be excised.

This tool uses a histogram-based approach to locate the hottest and coldest pixels in the image. Given a distribution of counts, the "centermost" portion is selected as being good (the "keepfract" amount). If keepfract is 0.98, then 98% of the detectors are selected as good. The selection window is further enlarged by bands on either side using the guardfract and guardval parameters. Values outside the selection window are considered to be "cold" (too low) or "hot" (too high).

The output of the tool is a quality map of the same dimensions as the detector image. Values stored in the map are determined by the keywords below, but typically a value of 0 indicates a good pixel. This mask can be input into downstream image processing stages. The second extension, BADPIX, is a binary table containing a list of bad pixels.

Users can submit an existing detector mask using the detmask parameter. Pixels with bad quality are ignored by bathotpix in computing the distribution and selection windows. By default, the input mask is logically AND'd with the result, so that the output is the cumulative record of excised pixels. By default, BAT detector gaps are also excised.


infile [filename]
Input file name containing a detector plane image.

outfile [filename]
Output detector mask image.

(detmask = "NONE") [string]
Input detector mask image. Pixels with bad quality are ignored in the bathotpix analysis.

(row = 1) [integer]
Image number to process, where the first image is number 1. This applies both to files with multiple image extensions (where 'row' selects the extension number) and to files with one binary table extension (where 'row' selects the table row).
(keepfract = 0.98) [real]
Fraction of non-zero detectors to select as good, initially.

(guardfract = 0.25) [real]
Fractional amount to enlarge initially selected detectors, relative to the median value. A value of 0.25 indicates an enlargement of 0.25 x the median on both sides of the distribution.

(guardval = 5.0) [real]
Further amount to enlarge the selection window, this time in counts. This keyword is present for the case of an image with very small dynamic range, where guardfract may be too small to be effective.

(applygaps = yes) [boolean]
If yes, then positions of BAT detector gaps are excised.

(mergemask = yes) [boolean]
If yes, then the input mask is merged with the result before writing to the output. If no, then only the pixels adjusted within this run of bathotpix are written.

(zerothresh = 20.0) [real]
Threshold value. If the median is above zerothresh, then pixels with zero are considered to be COLD. If the median is below zerothresh, i.e. the total number of counts is very low, then pixels with zero are considered to be okay.

(goodval = 0) [integer]
Value to be used in detector mask maps to indicate a good pixel.

(badval = 1) [integer]
Value to be used in detector mask maps to indicate a bad pixel, such as a detector gap.

(hotval = 1) [integer]
Value to be used in detector mask maps to indicate a hot pixel.

(coldval = 1) [integer]
Value to be used in detector mask maps to indicate a cold pixel.

(clobber = NO) [boolean]
If the output file already exists, then setting "clobber = yes" will cause it to be overwritten.

(chatter = 1) [integer, 0 - 5]
Controls the amount of informative text written to standard output. Setting chatter = 1 produces a basic summary and image statistics; chatter = 2 (default) additionally prints a summary of input parameters; chatter = 3 prints detailed information on which hot and cold detectors; chatter = 5 prints debugging information.

(history = YES) [boolean]
If history = YES, then a set of HISTORY keywords will be written to the header of the specified HDU in the output file to record the value of all the task parameters that were used to produce the output file.


1. Locate hot pixels in a detector plane image

        bathotpix image.dpi image.mask

2. Same as example 1, but an input mask is also supplied

        bathotpix image.dpi image.mask detmask=apriori.mask




Aug 2006