[Top] [Prev] [Next] [Bottom]

16.3 Basic Data Reduction: calnica

The calnica task (Figure 16.1) operates on individual NICMOS datasets and performs the job of removing the instrumental signature from the raw science data. The calnica task also tries to identify cosmic ray hits in the MULTIACCUM images.-

Figure 16.1: Conceptual calnica Pipeline; CDB is the Calibration DataBase

The inputs to calnica are the raw science (*_raw.fits) files. The output of calnica is usually a single file containing the calibrated science data (*_cal.fits). For MULTIACCUM mode datasets there is an additional intermediate output file (*_ima.fits) which contains the calibrated data from all the intermediate readouts. The _ima.fits data are fully calibrated up to, but not including, the cosmic ray rejection. The format and contents of the input and output science data files are identical so that the output data can be reused as input to calnica, if desired. One could, for example, process a science data file through some subset of the normal calibration steps performed by calnica, examine or modify the results, and then process the data through calnica again, performing other calibration steps or using alternate calibration reference files.

Figure 16.2 shows the portion of a calibrated NICMOS science file header containing the switches and reference file keywords that pertain to the processing performed by calnica. The accompanying flow chart (Figure 16.3) shows the sequence of calnica calibration steps, the input data and reference files and tables, and the output data file. Each calibration step is described in detail in the following sections.

Figure 16.2: Partial NICMOS Header


Figure 16.3: Pipeline Processing by calnica

ZOFFCORR

The ZOFFCORR step of calnica performs the subtraction of the zeroth read from all readouts in a MULTIACCUM file. This step is performed for data generated by the MULTIACCUM readout mode only. For other readout modes, the subtraction of the zeroth read is performed on-board, because the images returned to the ground are formed by taking the difference of initial and final non-destructive detector readouts.

The pipeline will subtract the zeroth read image from all readouts, including the zeroth read itself. Furthermore, the self-subtracted zeroth-read image will be 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. After this step is performed, the science data are in the same form as the raw science data from any other observing mode and are processed the same way throughout the remaining steps of calnica. No reference files are used by this step.

MASKCORR

Flag values from the static bad pixel mask file are added to the DQ image. This uses the MASKFILE reference file, which contains a flag array for known bad (hot or cold) pixels. There is one MASKFILE for each detector.

BIASCORR

NICMOS uses 16-bit analog-to-digital converters (ADCs), which convert the analog signal generated by the detectors into signed 16-bit integers. Because the numbers are signed and because the full dynamic range of the converter output is used, raw pixel values obtained from individual detector readouts can range from -32768 to +32767 DN. In practice the detector bias level is set so that a zero signal results in a raw value on the order of -23000 DN. In ACCUM, BRIGHT OBJECT, and RAMP modes, where the difference of initial and final readouts is computed on-board, the subtraction is also performed in 16-bit arithmetic. Therefore, it is possible that the difference between the final and initial pixel values for a bright source could exceed the dynamic range of the calculation, in which case the final pixel value will wrap around the maximum allowed by the 16-bit arithmetic, resulting in a negative DN value. Given the level at which the NICMOS detectors saturate, and the analog-to-digital conversion factor, the maximum "real" pixel value that is expected is on the order of +40000 DN. Such a value will be wrapped to about -26000 DN by the on-board difference calculation.

The BIASCORR step therefore searches for pixel values in the range -26000 to -32768 and adds an offset of 65536 DN to these pixel values to reset them to their original real values.

No reference files are used by this step.

NOISCALC

NICMOS calculates statistical errors for the science data only in the RAMP observing mode. Errors for all other modes are computed in the calnica pipeline. The NOISCALC step performs the task of computing an estimate of the errors associated with the raw science data based on a noise model for each detector. Currently the noise model is a simple combination of detector read noise and Poisson noise in the signal, such that:

Eq. 16.1


where rd is the read noise in units of electrons, adcgain is the analog-to-digital conversion gain factor (in electrons per DN) and counts is the signal in a pixel in units of DN. Noise is computed in units of electrons, but the result is converted to units of DNs for storage in the error image. The detector read noise is read pixel-by-pixel from the NOISFILE reference image and depends on the read rate of the observation, as well as the number of initial and final reads (NREAD). Separate NOISFILEs are required for each combination of read rate and NREAD. The data quality flags set in the DQ image of the NOISFILE are propagated into the DQ images of all image sets (imsets) being processed.

For RAMP mode observations, the error estimate computed by the instrument (and therefore, present in the raw science file) is a variance. For these observations the NOISCALC step simply computes the square-root of the raw error image so that it is on the same basis as other modes.

Throughout the remaining steps in calnica, the error image is processed in lock-step with the science image, getting updated as appropriate. Errors are mostly propagated through combination in quadrature.

DARKCORR

The detector dark current is removed from the science image by subtracting a dark current reference image appropriate for the exposure time of the science data.

A simple scaling of a single dark reference image to match the exposure time of the science data is, unfortunately, not possible due to the non-linear behavior of the dark current as a function of time. Therefore, a library of dark current images is maintained, covering the range of exposure times of the MULTIACCUM sequences and a subset of ACCUM exposure times and NREAD values (see the NICMOS Instrument Handbook). The reference dark appropriate for the exposure time and sequence used in MULTIACCUM, or the exposure time and NREAD values used in ACCUM, is determined and subtracted from the data. For non-standard MULTIACCUM sequences (see the NICMOS Instrument Handbook) and for some ACCUM exposure times, the appropriate dark image is interpolated from existing dark files. There is one reference file (DARKFILE) per detector, which contains the set of dark images (at various exposure times) for that detector. Error estimates of the dark current, stored in the ERR images of the DARKFILE, are propagated in quadrature into the ERR images of all processed IMSETs. Data quality (DQ) flags set in the DARKFILE are also propagated into the DQ images of all processed imsets.

Sets of synthetic dark reference files have been recently generated to populate the calibration database. These dark files reproduce all the characteristics of on-orbit darks, which do not suffer from the pedestal (see Chapter 17).

Dark subtraction is skipped in BRIGHTOBJ mode, because the short exposure times should result in insignificant dark current.

NLINCORR

The linearization correction step corrects the integrated counts in the science image for the non-linear response of the detectors. The observed response of the detectors can conveniently be represented by 3 regimes:

FLATCORR

In this step the science data are corrected for variations in gain between pixels by multiplying by an (inverse) flatfield reference image. This step is skipped for observations using a grism because the flatfield corrections are wavelength dependent. This step uses the FLATFILE reference file, which contains the flatfield image for a given detector and filter (or polarizer) combination. Error estimates and DQ flags contained in the FLATFILE are propagated into the processed images. There is one FLATFILE per detector and filter combination.

UNITCORR

The conversion from raw counts to count rates is performed by dividing the science and error image data by the exposure time. No reference file is needed.

PHOTCALC

This step provides photometric calibration information by populating the photometry keywords PHOTMODE, PHOTFLAM, PHOTFNU, PHOTZPT, PHOTPLAM, and PHOTBW with values appropriate to the camera and filter combination used for the observation. The photometry parameters are read from the PHOTTAB reference file, which is a FITS binary table containing the parameters for all observation modes. The values of PHOTFLAM and PHOTFNU are useful for converting observed count rates to absolute fluxes in units of erg/s/cm2/Angstrom or Jy, respectively.

CRIDCALC

This step identifies and flags pixels suspected of containing cosmic ray (CR) hits. For MULTIACCUM mode observations, this step also combines the data from all readouts into a single image. In MULTIACCUM mode, the data from all readouts are analyzed pixel-by-pixel, searching for and identifying the data from individual readouts that appear as outliers using an iterative sigma-clipping technique. In each pixel, the signal from each readout is ascribed a standard deviation given by the combination of readnoise and Poisson noise. Values which deviate more than 5 from the mean slope of the counts-versus-time relation are identified as outliers, and the corresponding pixels in the DQ images of the intermediate MULTIACCUM (*_ima.fits) file are flagged, however, the pixel values themselves in the SCI and ERR images are unchanged. Once all outliers have been identified, a final, combined value is computed for each pixel using only non-flagged samples. The result of this operation is stored as a single imset in the output *_cal.fits file in which the number of unflagged samples used to compute the final value for each pixel and the total exposure time of those samples will be reflected in the SAMP and TIME images. The variance ascribed to the final mean countrate is the uncertainty in the slope of the counts-versus-time relation at each pixel location. Pixels for which there are no unflagged samples, e.g., permanently hot or cold pixels, will have their output SCI, ERR, SAMP, and TIME values set to zero, with a DQ value that contains all flags that were set. The cosmic ray rejection threshold, 5 , is currently hardwired in the calnica code, and seems to perform a reasonable job of identifying and rejecting cosmic rays.

The algorithm is not yet completely defined or implemented for ACCUM, BRIGHTOBJ, and RAMP mode observations, therefore the *_cal.fits output file for these modes will still contain cosmic ray hits.

BACKCALC

This step computes a predicted background (sky plus thermal) signal level, based on models of the zodiacal scattered light and the telescope plus instrument thermal background. This step uses the BACKTAB reference table which contains the background model parameters. Results are written to the BACKEST1, BACKEST2, and BACKEST3 header keywords. The image data are not modified in any way. This step is not yet implemented.

WARNCALC (User Warnings)

In this step various (as yet undetermined) engineering keyword values are examined and warning messages are generated if there are any indications that the science data may be compromised due to unusual instrumental characteristics or behavior. This step is not yet implemented.



[Top] [Prev] [Next] [Bottom]

stevens@stsci.edu
Copyright © 1997, Association of Universities for Research in Astronomy. All rights reserved. Last updated: 11/13/97 17:19:03