INTERP: Interpolate Across Rows, Columns, or Masked Pixels



INTERP may be used to remove bad portions of an image. It works by replacing the bad pixels with a polynomial fit to several pixels on either side of the bad part. It is an inherently one-dimensional interpolation, in that it will only interpolate either along a column or along a rows. Hence if you have a bad column you want to get rid of, specify the COL keyword. If you need to replace a bad row, use ROW. Note that ONE of these two keywords MUST be specified. The region across which the interpolation is done is specified by defining a box containing the region. A list of boxes may be given via the BOX= keyword, in case you want to remove a number of bad columns (or rows) from an image. An alternate form uses the MASK keyword. When this is used the program searches the image for the first masked pixel, continues until the next unmasked pixel, and interpolates across this region. Then it proceeds until it finds the next masked pixel, and repeats the process until no more masked pixels have been found. Note that the BOX= and MASK keywords are incompatible; use only one or the other.

The order of the interpolation-polynomial is given with the ORD=n keyword. The default is ORD=0, so that the bad pixels are replaced simply by the average of the adjacent pixels. This works fine for flat images, but when interpolating across stars or spectra ORD=2 works much better (higher orders up to 6 are allowed but are rarely needed). The user can change the number of pixels to be used in the fit by the AVE= keyword. AVE pixels at each side of the bad region are used in the fit. The value of AVE has to be at least (ORD+1)/2, if a smaller value is given, the order of the interpolation-polynomial will be reduced to the highest allowed order. The default value is AVE=1; in other words, replaces the bad pixels with the line (or the average if ORD=0) defined by the pair of adjacent pixels (one pixel on either side) of the bad region.

Examples: