The calwf3 pipeline consists of four individual calibration tasks:
wf3ccd,
wf32d,
wf3ir, and
wf3rej. These tasks are diagrammed in
Figure 3.2.
calwf3 is responsible for controlling the processing rather than actually calibrating the data. The individual tasks apply the desired calibration steps to the data and create the output products, including the trailer files, which record a processing log.
In the following four sections, we describe each calwf3 task, give a detailed description of the calibration steps performed within each task, and give a brief description of the reference files used for each step.
This routine contains the initial processing steps for all WFC3 UVIS channel data. These steps are listed in operational order in Table 3.4. The calibration switch keywords and reference file keywords that are used for these steps are listed in
Figure 3.2. Only those steps with switch values of ‘
PERFORM’ in the input _raw.fits files will be executed. Each such switch value will be set to
COMPLETE in the corresponding output files.
Input to wf3ccd is an image list or single image that is either automatically called by
calwf3 or input directly by the user.
wf3ccd processes each image in the input list one at a time, using the header keywords to determine which calibration steps are to be performed and which calibration reference files to use in each step. It also processes the image data from both CCD chips contained in the input file. Upon completion of
wf3ccd, the overscan regions will be trimmed from the image and the blv_tmp output image is created. A description of each step follows.
Table 3.4: wf3ccd processing steps.
The CCDTAB reference file, the CCD Characteristics Table, contains the bias, gain, and readnoise values for each CCD amplifier quadrant used in this calculation. The table contains one row for each configuration that can be used during readout, which is uniquely identified by the list of amplifiers (
CCDAMP), the particular chip being read out (
CCDCHIP), the commanded gain (
CCDGAIN), the commanded bias offset level (
CCDOFST), and the pixel bin size (
BINAXIS). These commanded values are used to find the table row that matches the characteristics of the image that is being processed and reads each amplifier’s characteristics, including readnoise (
READNSE), A-to-D gain (
ATODGN), and mean bias level (
CCDBIAS).
DQICORR initializes the data quality (DQ) array by reading a table of known bad pixels for the detector, stored in the ‘Bad Pixel’ reference table (
BPIXTAB). The types of bad pixels that can be flagged are listed in
Table 2.5
The DQ array may already have been populated with some values to flag pixels affected by telemetry problems during downlink. Other DQ values will only be marked during further processing (such as cosmic-ray rejection). This function also checks pixel values in the SCI extension for saturation, using the value of the SATURATE column in the CCD parameters table (
CCDTAB). Any SCI array pixel value that is greater than the
SATURATE value will be assigned the appropriate flag value in the DQ array. This function also checks for SCI array pixel values that have reached the limit of the detector’s 16-bit A-to-D converters, flagging any pixel with a value > 65534 DN with the ‘A-to-D saturation’ DQ value.
DQICORR combines the DQ flags from preprocessing,
BPIXTAB, and saturation tests into a single result for the particular observation. These values are combined using a bit-wise logical OR operation for each pixel. Thus, if a single pixel is affected by two DQ flags, those flag values will be added in the final DQ array. This array then becomes a mask of all pixels that had some problem coming into the calibrations, so that the calibration processing steps can ignore bad pixels during processing.
The BPIXTAB reference file maintains a record of the x, y position and DQ value for all known bad pixels in each CCD chip for a given time period.
BLEVCORR fits the bias level in the CCD overscan regions and subtracts it from the image data. The boundaries of the overscan regions are taken from the
OSCNTAB reference file. With these regions defined, the serial and parallel virtual overscans are analyzed to produce a two-dimensional linear fit to the bias level. The overscan level for each row of the input image is measured within the serial virtual overscan region, utilizing sigma-clipping to reject anomalous values (e.g., cosmic-ray hits that occur in the overscan) and a straight line is fit as a function of image line number. The same procedure is followed for the parallel overscan, resulting in a straight line fit as a function of image column number. The parallel fit is computed in the form of a correction to be added to the serial fit result, in order to remove any gradient that may exist along the x-axis direction of the image. The serial fit and the parallel correction to it are then evaluated at the coordinates of each pixel and the computed bias value is subtracted from the pixel. This is done independently for each region of the image that was read out by one of the four CCD amplifiers. The mean bias value determined for each of the amplifier quadrants is recorded in the primary header keywords BIASLEV[ABCD] and the overall mean bias value is computed and written to the output SCI extension header as
MEANBLEV.
The full bias level-subtracted image is retained in memory until the completion of all the processing steps in wf3ccd. The overscan regions will not be trimmed until the image is written to disk at the completion of
wf3ccd.
The OSCNTAB reference file (Overscan Region Table) describes the overscan regions for each chip along with the regions to be used for determining the actual bias level of the observation. Each row corresponds to a specific configuration, given by the CCD amplifier, chip, and binning factor used. The
OSCNTAB columns
BIASSECTAn and
BIASSECTBn give the range of image columns to be used for determining the bias level in the leading and trailing regions, respectively, of the serial physical overscan regions, while columns
BIASSECTCn and
BIASSECTDn give the range of columns to be used for determining the bias level from the serial virtual overscan regions. The parallel virtual overscan regions are defined in the
OSCNTAB in the VXn and VYn columns.
To determine which overscan regions were actually used for measuring the bias level, check the OSCNTAB reference file. Users may modify the overscan region definitions in the reference table for manual calibration, but the
TRIMXn and
TRIMYn values must not be changed.
BIASCORR subtracts the superbias reference image. The reference image,
BIASFILE, must have the same values of
DETECTOR,
CCDAMP,
CCDGAIN, and
BINAXISi as the image being processed. The dimensions of the science image are used to distinguish between full- and sub-array images. Because the bias image is already overscan-subtracted, it will have a mean pixel value of less than one.
The BIASFILE has the same dimensions as a full-size science image complete with overscan regions (4206 x 2070 per chip for an unbinned image). Only after the completion of
wf3ccd are the science images trimmed to their final calibrated size (4096 x 2051 per chip for an unbinned image). A
BIASFILE with a binning factor that matches the science data must be used. For sub-array images, however, it is not necessary to use a matching sub-array
BIASFILE.
calwf3 will extract the matching region from the full-size
BIASFILE and apply it to the sub-array input image.
This function subtracts the post-flash reference image, FLSHFILE, from the science image. This file has the same dimensions as a full-size science image complete with overscan regions.
FLSHFILE has units of electrons per second (e-/s)
. The appropriate
FLSHFILE has matching values of the following keywords from the image header:
DETECTOR,
CCDAMP,
CCDGAIN,
FLASHCUR, BINAXISi, and
SHUTRPOS.
The success of the post-flash operation during the exposure is first verified by checking the keyword FLASHSTA. If any problems were encountered, a comment will be added to the history comments in the SCI extension header.
calwf3 selects the reference file which matches the science image‘s binning, shutter and current level settings, converts the file to DN using the gain, and then scales by post flash duration (
FLASHDUR) before subtracting from the science image
. The mean value of the scaled post-flash image is written to the output SCI extension header in the keyword
MEANFLSH.
If BLEVCORR was performed, the overscan regions are trimmed from the image when it is written out to the *_blv_tmp.fits file. Otherwise, the full image array is written out. The keywords
CRPIXi,
LTVi, and
SIZAXISi are updated in the output image extensions to reflect the offset of the image origin and the reduction in image size due to removing the overscan. The
OSCNTAB reference table columns
TRIMXn give the number of columns to trim off the beginning, end, and middle of each line (the serial physical and virtual overscan regions), while the n columns give the number of rows to trim off the top and bottom of each column (the parallel virtual overscan region) when the overscan-trimmed image is written to disk.
If multiple images from a CR-SPLIT or
REPEAT-OBS set are being processed, the *_blv_tmp.fits files are sent to the
wf3rej task to be combined. The resulting combined image (*_crj_tmp.fits) is then sent to
wf32d for final calibration. If multiple images are not being combined, the blv_tmp.fits files are sent directly to
wf32d for final calibration.
The wf32d primary functions are listed in
Table 3.5 and include dark current subtraction, flat fielding, and photometric keyword calculations. The calibration switch and reference file keywords used by these steps are listed in
Figure 3.3. Only those steps with a switch value of ‘
PERFORM’ in the input files will be executed, after which the switch value will be set to ‘
COMPLETE’ in the corresponding output files.
wf32d contains the same ERR and DQ array initialization functions used in
wf3ccd, but
wf32d will check to ensure that these functions are not performed twice on the data. Calibration switches in the image header control the performance of the remaining calibration functions.
wf32d first checks to see if the image ERR array has already been populated, indicating that previous processing has been performed. If not,
wf32d performs the same initialization as described for
wf3ccd. If the input image has already been processed this step is skipped and no changes are made to the ERR array.
If the DQICORR header keyword switch is set to ‘
COMPLETE’, this step will be skipped. Otherwise, the same initialization will be performed as described for
wf3ccd.
This function is responsible for subtracting the dark current image from the input image. The dark image (in units of electrons/sec) is multiplied by the exposure time and divided by the gain before subtracting. The dark reference file, DARKFILE, is read in line-by-line and subtracted from the input image in memory. The mean dark value is computed from the scaled dark image and used to update the
MEANDARK keyword in the SCI image header. The dark reference file will be updated frequently and will allow the tracking of hot pixels over time.
The reference file for dark subtraction, DARKFILE, is selected based on the values of the keywords
DETECTOR,
CCDAMP, and
BINAXISi in the image header. The dark correction is applied after the overscan regions are trimmed from the input science image. As for the
BIASFILE,
calwf3 requires the binning factors of the
DARKFILE and science image to match.
Sub-array science images use the same reference file as a full-sized DARKFILE.
calwf3 simply extracts the appropriate region from the reference file and applies it to the sub-array input image.
•
|
Reference Files: PFLTFILE (*_pfl.fits), LFLTFILE (*_lfl.fits), DFLTFILE (*_dfl.fits)
|
Up to three separate flat-field reference files can be applied: the pixel-to-pixel flat-field file (PFLTFILE), the low-order flat-field file (
LFLTFILE), and the delta flat-field file (
DFLTFILE). The
PFLTFILE is a pixel-to-pixel flat-field correction file containing the small-scale flat-field variations. Unlike the other flat fields, the
PFLTFILE is always used in the calibration pipeline. The
LFLTFILE is a low-order flat that corrects for any large-scale sensitivity variations across each detector. This file can be stored as a binned image, which is then expanded when being applied by
calwf3. Finally, the
DFLTFILE is a delta-flat containing any needed changes to the small-scale
PFLTFILE.
If the LFLTFILE and
DFLTFILE are not specified in the SCI header, only the
PFLTFILE is used for the flat-field correction. If two or more reference files are specified, they are read in line-by-line and multiplied together to form a combined flat-field correction image.
The SHADCORR routine applies the shutter shading correction image (
SHADFILE) to the science data. This corrects the input image for the differential exposure time across the detector caused by the amount of time it takes for the shutter to completely open and close, which is a potentially significant effect only for images with very short exposure times (less than ~5 seconds).
The SHADFILE is selected using the
DETECTOR keyword in the input science image. This reference file is normally binned, because the correction varies slowly across the image.
The shutter shading correction can be applied either during wf32d processing for single exposures or during cosmic-ray rejection in
wf3rej for
CR-SPLIT and
REPEAT-OBS exposures.
Before photometry can be derived from WFC3 observations, a transformation to absolute flux units must be done. calwf3 follows the WFPC2 and ACS methodology for calculating the photometry keywords in the calibration pipeline. The calibration reference file
IMPHTTAB contains the precomputed values for the photometric keywords for all detector and filter combinations (please refer to
Section 5.2.1 for details on how to set up environment variables that give the location of this files on your system). For further discussion of
pysynphot, refer to Chapter 3 of the
Introduction to the HST Data Handbooks.
During this process the keyword PHOTMODE is built to reflect the configuration of the instrument for the exposure (e.g., ‘WFC3,UVIS1,F814W’).
calwf3 then uses the
PHOTMODE string with
pysynphot to retrieve the keyword values from the reference file and update the data header:
•
|
PHOTFLAM: the inverse sensitivity in units of erg cm -2 A -1 electron -1
|
•
|
PHOTFNU: the inverse sensitivity in units of Jy sec -1 electron -1
|
•
|
PHOTZPT: the Space Telescope magnitude zero point
|
•
|
PHOTPLAM: the bandpass pivot wavelength
|
•
|
PHOTBW: the bandpass RMS width
|
Users who wish to convert calibrated images (which are in units of electrons) to flux units can simply divide the image by the exposure time and then multiply by the PHOTFLAM keyword value. Drizzled (drz) images are already in units of electrons per second and therefore only need to be multiplied by the
PHOTFLAM value to obtain flux units.
This routine contains all the instrumental calibration steps for WFC3 IR channel images. The steps are listed in operational order in Table 3.6. The calibration switch and reference file keywords used by these steps are listed in
Figure 3.4 Only those steps with a switch value of P
ERFORM in the _raw.fits files will be executed, after which the switch value will be set to ‘
COMPLETE’ in the corresponding output files.
Input to wf3ir is an image list or single image that is either automatically called by
calwf3 or input directly by the user.
wf3ir processes each image in the input list one at a time, using the header keywords to determine which calibration steps are to be performed and which calibration reference files to use in each step.
The process begins working with the raw IR image file, which contains all of the non-destructive readouts for an exposure. Most of the calibration steps are applied independently to each readout. For example, the DQICORR,
NLINCORR, and
FLATCORR steps apply the same bad pixel flags, non-linearity correction coefficients, and flat-field image, respectively, to each readout. The
CRCORR step, on the other hand, which attempts to remove the effects of cosmic rays, utilizes the values from all readouts of individual pixel simultaneously. Detailed descriptions of each step are provided in the following sections.
All steps up through UNITCORR are applied to an in-memory image stack that contains all the readouts. The
CRCORR step produces an additional single image that gives the best-fit count rate for each pixel. The remaining steps in the process -
FLATCORR and image statistics - are then applied to the full stack of readouts and to the single image produced by
CRCORR.
Upon completion of wf3ir, two output files are produced. The Intermediate MultiAccum (ima) file, which contains the full stack of calibrated readouts, and the final calibrated image (flt) file, which is the single image produced by
CRCORR (with subsequent flat fielding applied). The flt file has the reference pixel regions trimmed from the image, so that it is appropriate to use in further processing, such as
AstroDrizzle.(Note: although the flt images are normally flat fielded, this is only the case if the flat-fielding step
FLATCORR is performed.)
DQICORR populates the data quality (DQ) array in all IR readouts by reading a table of known bad pixels for the detector, stored in the ‘Bad Pixel’ reference table (
BPIXTAB). The types of bad pixels that can be flagged are listed in
Table 2.5.
The reference file for data quality initialization, BPIXTAB, is selected based on the value of the
DETECTOR keyword only.
The ZSIGCORR step is used to estimate the amount of source signal in the zeroth read and to supply this estimate to the
NLINCORR step for linearity corrections and saturation checking.
ZSIGCORR estimates the signal in the zeroth read by first measuring the signal in each pixel between the zeroth and first reads, and then scaling that signal to the effective exposure time of the zeroth read (nominally 2.9 seconds). Pixels that have an estimated zeroth read signal greater than 5 times their estimated uncertainty (noise) value are assumed to contain detectable signal; those below this threshold are ignored. The estimated zeroth read signal is then passed, as an in-memory image, to the
NLINCORR step, which accounts for that signal when applying linearity corrections and saturation checking on the zeroth-read subtracted images.
The reference files used in this step, DARKFILE and
NLINFILE, are selected from CDBS based on the values of the
DETECTOR,
CCDAMP, CCDGAIN,
SAMP_
SEQ, and
SUBTYPE keywords. The
DARKFILE file is used to subtract dark current from the first-minus-zero read difference image before using it to estimate incoming signal levels and the
NLINFILE is used to perform saturation checking.
BLEVCORR uses the reference pixels located around the perimeter of the IR detector to track and remove changes in the bias level that occur during an exposure. For each raw readout, the mean signal level of the reference pixels is computed and subtracted from the image, and recorded in the
MEANBLEV keyword in the SCI header of each readout.
The reference file for bias level correction, OSCNTAB, is selected from CDBS based on the value of the
DETECTOR keyword only.
ZOFFCORR subtracts the zeroth read from all readouts in the exposure, including the zeroth read itself, resulting in a zero-read image that is exactly zero in the remainder of processing. The zeroth-read image is propagated through the remaining processing steps and included in the output products, so that a complete history of error estimates and data quality (DQ) flags is preserved.
The CCDTAB reference file used in this step is selected based on the value of the
DETECTOR keyword only.
NLINCORR corrects the integrated counts in the science images for the non-linear response of the detector and flags pixels that go into saturation. The observed response of the detector can be conveniently represented by two regimes:
where c1, c
2. c
3 and c
4 are the correction coefficients, F is the uncorrected flux (in DN) and F
c is the corrected flux. The current form of the correction uses a third-order polynomial, as shown here, but the algorithm can handle an arbitrary number of coefficients. The number of coefficients and error terms are given by the values of the
NCOEF and
NERR keywords in the header of the
NLINFILE.
This step uses the NLINFILE reference file, which includes a set of images containing the cn correction coefficients and their variances at each pixel. The [NODE,1] image extension in the
NLINFILE gives the saturation value for each pixel, in units of DN. Each pixel that has an input value below its defined saturation level is corrected according to the equation above. Pixels at or above their saturation values receive no correction and are flagged as saturated in the DQ array for the readout. Any pixel flagged as saturated in a given readout is also automatically flagged as saturated in all subsequent readouts.
As mentioned in the description of the ZSIGCORR routine, the estimated amount of signal in the zeroth read of the exposure is temporarily added back into the signal of each pixel during the
NLINCORR step, before the pixel is checked for saturation or receives the linearity correction. Once the correction has been applied, the zero read signal is again removed. This process only occurs if the
ZSIGCORR step is turned on during processing.
The NLINFILE reference files is selected based on the value of the
DETECTOR keyword only.
DARKCORR subtracts the detector dark current from the science data. Due to potential non-linearities in some of the signal components, such as reset-related effects in the first one or two reads of an exposure, the dark current subtraction is not applied by simply scaling a generic reference dark image to the exposure time and then subtracting it. Instead, a library of dark current images is maintained that includes darks taken in each of the available predefined MultiAccum sample sequences, as well as the available sub-array readout modes. The MultiAccum dark reference file is subtracted read-by-read from the stack of science image readouts. Thus there is an exact match in the timings and other characteristics of the dark image that is subtracted from each science readout.
The DARKFILE reference file must have the same values for the
DETECTOR,
CCDAMP, CCDGAIN,
SAMP_SEQ, and SUBTYPE keywords as the science image.
Before photometry can be derived from WFC3 observations, a transformation to absolute flux units must be done. calwf3 follows the WFPC2 and ACS methodology for calculating the photometry keywords in the calibration pipeline. The calibration reference file
IMPHTTAB contains the values of the latest WFC3 photometry keywords as calculated by
pysynphot as a function of wavelength for the various WFC3 detector and filter combinations.For further discussion of
pysynphot, refer to Chapter 3 of the
Introduction to the HST Data Handbooks.
During this process the keyword PHOTMODE is built to reflect the configuration of the instrument for the exposure (e.g., ‘WFC3,IR,F160W’).
calwf3 then uses the
PHOTMODE string with
pysynphot to compute the total throughput for this instrument mode, based on the optics and filter throughputs and the detector QE. From that information, it computes values for the following photometry keywords.
•
|
PHOTFLAM: the inverse sensitivity in units of erg cm -2 A -1 electron -1
|
•
|
PHOTFNU: the inverse sensitivity in units of Jy sec -1 electron -1
|
•
|
PHOTZPT: the Space Telescope magnitude zero point
|
•
|
PHOTPLAM: the bandpass pivot wavelength
|
•
|
PHOTBW: the bandpass RMS width
|
CRCORR combines the data from all readouts into a single image and in the process identifies and flags pixels suspected of containing cosmic-ray (CR) hits. The data from all readouts are analyzed pixel-by-pixel, iteratively computing a linear fit to the accumulating counts-versus-exposure time relation. Samples flagged as bad in the DQ arrays, such as when saturation occurs midway through the exposure, are rejected from the fitting process. CR hits are identified by searching for outliers from the fit results. The rejection threshold is set by the value in the ‘
CRSIGMAS’ column of the Cosmic-Ray Rejection parameters reference table (
CRREJTAB), which currently has a default value of 4s. When a CR hit is detected, a linear fit is then performed independently for the sets of readouts before and after the hit. Those fitting results are then again checked for outliers. This process is iterated until no new samples are rejected. Pixel samples identified as containing a CR hit are flagged in the DQ arrays of the intermediate MultiAccum (ima) file, with a DQ value of 8192. The pixel values in the SCI and ERR images of the ima file, however, are left unchanged.
These DQ flags are only present in the ima file and do not get carried over into flt products which combine data from all readouts.
For pixels where calwf3 finds 4 or more cosmic rays up the ramp, it flags the pixel with flag value = 4 ("dead" or bad pixel), which does propagate to the flt. In that case, the thinking is that four large signal jumps for a given pixel in a single ramp means that something is going on with that pixel, and it should be thrown out.
•
|
Reference Files: PFLTFILE(*_pfl.fits),LFLTFILE(*_lfl.fits),DFLTFILE (*_dfl.fits)
|
FLATCORR corrects for pixel-to-pixel and large-scale sensitivity variations across the detector by dividing the science images by one or more flat-field images. A combined flat is created within
calwf3 using up to three flat-field reference files: the pixel-to-pixel flat (c), the low-order flat (
LFLTFILE), and the delta flat (
DFLTFILE).
FLATCORR also multiplies the science data by the detector gain so that the calibrated data will be in units of electrons per second (or electrons if
UNITCORR is not performed).
The PFLTFILE is a pixel-to-pixel flat-field correction file containing the small-scale flat-field variations. The
PFLTFILE is always used in the calibration pipeline, while the other two flats are optional. The
LFLTFILE is a low-order flat that corrects for any large-scale sensitivity variations across the detector. This file can be stored as a binned image, which is then expanded when being applied by
calwf3. Finally, the
DFLTFILE is a delta-flat containing any needed changes to the small-scale
PFLTFILE.
If the LFLTFILE and
DFLTFILE are not specified in the SCI header, only the
PFLTFILE is used for the flat-field correction. If two or more reference files are specified, they are read in and multiplied together to form a combined flat-field correction image.
All flat-field reference images are chosen from CDBS based on the DETECTOR,
CCDAMP, and
FILTER used for the observation. A sub-array science image uses the same reference file(s) as a full-size image;
calwf3 extracts the appropriate region from the reference file(s) and applies it to the sub-array input image.
•
|
Header Keywords Updated: BADINPDQ,CRMASK,CRRADIUS,CRSIGMAS, CRTHRESH, EXPEND, EXPSTART, EXPTIME, INITGUES, MEANEXP,NCOMBINE,REJ_RATE,ROOTNAME,SCALENSE,SKYSUB, SKYSUM
|
wf3rej, the cosmic-ray rejection and image combination task in
calwf3, combines
CR-SPLIT or
REPEAT-OBS exposures into a single image, first detecting and then replacing flagged pixels. The task uses the same statistical detection algorithm developed for ACS (acsrej), STIS (ocrrej), and WFPC2 data (crrej), providing a well-tested and robust procedure.
First, wf3rej temporarily removes the sky background from each input image (if requested via the
SKYSUB parameter in the
CRREJTAB), usually computed using the mode of each image. Sky subtraction is performed before any statistical checks are made for cosmic rays. Next,
wf3rej constructs an initial comparison image from each sky-subtracted exposure. This comparison image can either be a median- or minimum-value sky-subtracted image constructed from all the input images, and it represents the ‘initial guess’ of a cosmic-ray free image. The comparison image serves as the basis for determining the statistical deviation of each pixel within the input images.
•
|
noise is the readnoise in DN squared and gain is the e-/DN of the amplifier used to read the pixel,
|
•
|
scale is the scale factor for the noise model,
|
•
|
value is the pixel value (in DN) from the median or minimum combined comparison image.
|
•
|
pixn is the pixel value from input image n,
|
•
|
skyn is the sky background of image n, and
|
•
|
median is the median or minimum pixel value from the comparison image.
|
•
|
T is the total exposure time (regardless of whether all input images were used for that particular pixel). This corresponds to the value recorded in the header keywords TEXPTIME and EXPTIME.
|
The remaining keywords EXPSTART,
EXPEND are updated based on the values corresponding to the first and last input images, respectively.
wf3rej uses the Cosmic Ray Rejection parameter table (
CRREJTAB) to determine the number of iterations for cosmic-ray rejection, the sigma levels to use for each iteration, and the spill radius to use during detection. This allows the rejection process to be tuned to each detector and observation, with suitable defaults being applied during pipeline processing. Observers may fine-tune the cosmic-ray rejection parameters when manually reprocessing data with
wf3rej by editing the
CRREJTAB.
The CRREJTAB reference file contains the basic parameters necessary for performing cosmic-ray rejection. The column names and default values for the
CRREJTAB are given in
Table 3.7. The appropriate row is selected based on the chip being processed (
CCDCHIP), the number of images into which the exposure was split (
CR-SPLIT), and the exposure time of each
CR-SPLIT image (
MEANEXP). If an exact match is not found for the exposure time, the table row with the closest value is used. If the
CR-SPLIT value of the input images exceeds the values in the table, the table row with the largest
CR-SPLIT value will be used. The sky fitting algorithm is controlled by the parameter
SKYSUB, which can have values of ‘mode’, ‘mean’ or ‘none’. The ‘initial guess’ image is created using the median or minimum value of the input exposures, as specified by the value of
INITGUES.
Cosmic-ray detection requires the specification of a threshold above which a pixel value is considered a cosmic ray. This threshold was defined above as and uses the sigma rejection thresholds. These sigmas correspond to the CRSIGMAS column values in the
CRREJTAB file.
SCALENSE is a multiplicative term (in percent) for the noise model and is given as scale in the threshold equation above. This term can be useful when the pointing of the telescope has changed by a small fraction of a pixel between images. Under such circumstances, the undersampling of the image by the detector will cause stars to be mistakenly rejected as cosmic rays if a scale noise term is not included. This is a crude but effective step taken to satisfy the maxim of ‘do no harm’. However, for cases in which there have been no image-to-image offsets or the image is locally well-sampled, this will unduly bias against rejecting cosmic rays.
Pixels within a given radius, CRRADIUS, of a cosmic ray will also be treated as cosmic rays. A less stringent rejection threshold,
CRTHRESH, can be used for detecting pixels adjacent to a cosmic ray. As for
CRSIGMAS,
CRTHRESH is also given as a sigma value. If
CRTHRESH is exceeded, pixels within the defined radius of the cosmic ray will also be flagged. All pixels determined to be affected by a cosmic ray will have their DQ values set to 8192, as described in
Table 2.5.