Spectroscopic datasets usually contain only a small number of frames so that bad pixels must be corrected by interpolation, and this interpolation should ideally be constrained to occur only in the spectral direction. The longer integration times used for spectroscopic datasets also demand the use of a more comprehensive bad pixel file than for imaging datasets. Procedures for defining an ascii bad pixel file were outlined in §6. The same bad pixel file used with noao.proto.fixpix can be used for spectroscopic data, but it is not possible to define the interpolation direction using fixpix. To do this, it is necessary to use the IRAF imedit task and specify a bad pixel file that can be used as the cursor input file to imedit. Rectangular regions are specified in this file by cursor records defining the corners of the rectangle. An l cursor command specifies interpolation between nearest image lines, so that interpolation occurs in the spectral direction. An example of such a file is listed below.
25 111 1 l 25 111 1 l 108 87 1 l 108 113 1 l 256 1 1 l 256 256 1 l 1 1 1 l 256 1 1 l 185 240 1 l 190 245 1 l
Files of this format are identified within the CASPIR package by a .bpx extension. The standard CASPIR spectroscopic bad pixel list plus a large number of high dark current pixels are contained in the file caspirdir$grism.bpx in this format. If the l cursor command were changed to an f in this file, imedit would interpolate in the shorter dimension of each rectangle and the operation would be equivalent to that of fixpix.
To apply a bad pixel correction using the redgspec task, set the fixbad flag and nominate the bad pixel filename and the type of correction using the badfile and badtype parameters. badtype=interpolate causes imedit to be used to interpolate over the bad pixels listed in a .bpx file. This is the preferred choice for spectroscopic data. badtype=fixpix causes fixpix to be used to interpolate over bad pixels listed in a .bad file. This is included for consistency with the imaging reduction procedure redimage. As with redimage, the badfile parameter should not include the file extension ( .bpx, .bad, or .pl). redgspec will append this.