GLITCH

Replaces bad pixels in a two-dimensional NDF with the local median

Description:

This routine removes bad pixels from a two-dimensional NDF , replacing them with the median of the eight (or less at the edges) neighbouring pixels. At least three of these eight neighbouring pixels must have good values (that is, they must not set to the bad value) otherwise the resultant pixel becomes bad.

The positions of the pixels to be removed can be supplied in four ways (see Parameter MODE):

Usage:

glitch in out [title]
incat=? infile=? pixpos=?

                    mode

Parameters:

IN = NDF (Read)
The input image.
INCAT = FILENAME (Read)
A catalogue containing a positions list giving the pixels to be replaced, such as produced by applications CURSOR, LISTMAKE. Only accessed if Parameter MODE is given the value "Catalogue".
INFILE = FILENAME (Read)
The name of a text file containing the positions of the pixels to be replaced. The positions should be given in the current co-ordinate Frame  of the input NDF, one per line. Spaces or commas can be used as delimiters between axis values. The file may contain comment lines with the first character # or !. This parameter is only used if Parameter MODE is set to "File".
MODE = LITERAL (Read)
The method used to obtain the positions of the pixels to be replaced. The supplied string can be one of the following options.
  • "Bad" –- The bad pixels in the input NDF are used.

  • "Catalogue" –- Positions are obtained from a positions list using Parameter INCAT.

  • "File" –- The pixel positions are read from a text file specified by Parameter INFILE.

  • "Interface" –- The position of each pixel is obtained using Parameter PIXPOS. The number of positions supplied must not exceed 200.

[current value]

OUT = NDF (Write)
The output image.
PIXPOS = LITERAL (Read)
The position of a pixel to be replaced, in the current co-ordinate Frame of the input NDF. Axis values should be separated by spaces or commas. This parameter is only used if Parameter MODE is set to "Interface". If a value is supplied on the command line, then the application exits after processing the single specified pixel. Otherwise, the application loops to obtain multiple pixels to replace, until a null (!) value is supplied. Entering a colon (":") will result in a description of the required co-ordinate Frame being displayed, followed by a prompt for a new value.
TITLE = LITERAL (Read)
Title for the output image. A null value (!) propagates the title from the input image to the output image. [!]

Examples:

glitch m51 cleaned mode=cat incat=badpix.FIT
Reads pixel positions from the positions list stored in the FITS file badpix.FIT, and replaces the corresponding pixels in the two-dimensional NDF m51 by the median of the surrounding neighbouring pixels. The cleaned image is written to cleaned.sdf.

Notes:

Related Applications

KAPPA: ARDMASK, CHPIX, FILLBAD, ZAPLIN, NOMAGIC, REGIONMASK, SEGMENT, SETMAGIC; FIGARO: CSET, ICSET, NCSET, TIPPEX.

Implementation Status: