STScI Logo
STScI Logo
HST
Banner
FAQStaff
STScI

HST Data Handbook for NICMOS

TOC PREV NEXT INDEX PDF

3.4 Mosaicing: calnicb


Observing strategies with NICMOS vary according to the nature of the target object and of the wavelength chosen for the observation. Extended objects may require mosaicing. Long wavelength observations will need chopping onto the sky to remove the telescope thermal background from the target frame. Multiple repetitions of the same exposure may be requested to improve cosmic ray removal, to control statistical fluctuations, and to increase the signal-to-noise on one target while avoiding saturation on another. Dither (mosaicing) and chop patterns of exposures are specified at the Phase II proposal level via the optional PATTERN parameter; multiple exposures at the same pointing are specified in Phase II by setting the Number_of_iterations to a value greater than one. All these options (which can also be set simultaneously) create an association of datasets (see the discussion of "Associations" in appendix B).

The calnicb task produces the combined, or mosaiced, image from the multiple images contained in a NICMOS association. The task also performs background subtraction and source identification on the images in the association.

It should be noted that calnicb is not the only method available for creating mosaics from multiple NICMOS images, nor is it necessarily ideal for all applications. It was designed to implement the potentially complex task of image mosaicing in a pipeline fashion, but sometimes a more careful, manual treatment can be worthwhile. Calnicb does not include any correction for geometric distortion in NICMOS images (which is small, but may be important for some applications; see section 5.4 for a discussion), nor does it allow pixel subsampling which may be useful in order to improve image resolution for undersampled images (especially with NIC3). Also, some NICMOS users dithered their observations "manually" using POS-TARG offsets rather than the canned patterns available in Phase II; such data sets will not be linked as associations in the HST archive. Finally, you may wish to have more interactive control over the various stages of the background subtraction, registration, and coaddition process than calnicb offers. When analyzing NICMOS data, you may find it useful to explore other means of combining dithered exposures into a final image mosaic, such as the drizzle routine and associated software available in the stsdas.analysis.dither package (see also section 5.4.4). For many applications, however, calnicb will produce excellent results.

The HST Dither Handbook (Koekemoer et al. 2002), provides extensive information about the software in the stsdas.analysis.dither package. The Handbook has many examples showing how to use the drizzling rountines, including one fully worked-out exercise concerning drizzling with NICMOS data.

3.4.1 Input Files

Three pieces of input data are needed by calnicb:

  1. The association table (assoc_id_asn.fits): this is a table containing the list of members in the association and relevant information on the association type, as given in table 3.1
Table 3.1: Columns of the Association Table (input to calnicb):
Column Name Meaning
MEMNAME Rootname (IPPPSSOOT) of each image in the association.
MEMTYPE Role or type of each member: EXP-TARG = input exposure for target EXP-BCKn = input exposure of n'th background (for chop patterns) PROD-TARG = output product containing target PROD-BCKn = output product containing n'th background (for chop patterns)
MEMPRSNT Flag indicating whether or not a member is present (needed by the STScI automatic pipeline processing).

 
  • The table extension header of the assoc_id_asn.fits file also contains the keywords which control the background illumination pattern correction (ILLMCORR). The keywords used are: ILLMCORR (whether or not the correction is to be performed) and ILLMFILE (reference file name for the illumination correction). These are explained in chapter 2, and discussed further in section 3.4.3.
  • The input calibrated images (ippssoot_cal.fits): the science data images which are part of the association, as listed in the first column of the association table. The images are usually the calibrated outputs of calnica.
  • The support files (ipppssoot_spt.fits), containing engineering information, so that calnicb can transfer this information to the output support files.

3.4.2 Output Files

Calnicb produces three types of output:

  1. An updated copy of the association table (assoc_id_asc.fits): this copy of the assoc_id_asn.fits file contains additional information about the processing that took place. The assoc_id_asc.fits file contains four additional columns, listed in table 3.2
Table 3.2: Additional Columns of the output Association Table:
Column Name Meaning
BCKIMAGE Flag indicating whether or not the image was used to compute the background.
MEANBCK Values of the mean background for the image (DN/sec).
XOFFSET X-offset (in pixels) of the image from the reference frame; a positive value means a positive offset of the image (not of the sources) relative to the reference.
YOFFSET Y-offset (in pixels) of the image from the reference frame; a positive value means a positive offset of the image (not of the sources) relative to the reference.

 
  • Additional information contained in the header of the assoc_id_asc.fits table is the MEAN_BKG keyword, which gives the constant background signal level subtracted from all images in the association.
  • One or more output mosaic images (assoc_idn_mos.fits): the number of output mosaic images depends on the pattern. The target field is always contained in the assoc_id0_mos.fits file. Patterns which involve chopping onto the sky to produce background reference images result in multiple assoc_idn_mos.fits files after processing through calnicb, with the background positions identified by n=1 to 8.
  • One assoc_idn_spt.fits support file for each assoc_idn_mos.fits file created.

3.4.3 Processing

The basic philosophy of the calnicb algorithm is to remove the background from each image after source identification, to align the images by calculating offsets, and to produce the final mosaic. The processing steps of calnicb can be summarized as follows:

  1. Read the input asn table and input images.
  2. Determine processing parameters from keyword values.
  3. Combine multiple images at individual pattern positions.
  4. Identify sources in the images.
  5. Estimate and remove the background signal.
  6. Create a mosaic image from all pattern positions.
  7. Write the output association table and mosaic images.

The sections below discuss steps 2 through 6 in greater detail.

Processing Parameters

Header keywords from the input *_cal.fits images are read and evaluated in order to guide the calnicb processing. One set of keywords (table 3.3) pertains to the association as a whole and therefore are read only once from the first input member image:

Table 3.3: Keywords Common to all Datasets in an Association
Keyword Purpose
INSTRUME Check whether they are NICMOS data.
CAMERA Camera number.
FILTER Filter name; if set to "BLANK", the association is made of darks.
IMAGETYP Type of image (EXT=external, DARK=dark frames, FLAT=flat-field images).
NUMITER Number of iterations for each exposure.
PATTERN Pattern used.
NUMPOS Number of independent positions in the pattern.

 

A second set of header keywords (table 3.4) are specific to each member of the association, and must be read from each input image.

Table 3.4: Dataset-specific Keywords
Keyword Purpose
PATT_POS Position of the image in the pattern.
BACKESTn Background estimates from calnica.
CRPIXn, CRVALn, CDn_n, CTYPEn World Coordinate System (WCS) information (see table 2.3).

 

Based on this information, an inventory is taken of which input images exist, where they belong in the pattern, how many images there are at each pattern position, which images belong to the target field, which ones are from background fields, and to which output mosaic image each input image will contribute. As part of the input process, the appropriate ILLMFILE reference file is loaded. Note, however, as is discussed below under "Background Estimation and Removal," the ILLMFILEs used in this step are dummies, and have no effect on the data. In fact, the ILLMFILEs provided by STScI have their PEDIGREE set to DUMMY, thus forcing the stage to be skipped. The dummy reference files must be present, however, in order for calnicb processing to proceed.

Combination of Multiple Exposures

If there is more than one image at any pattern position (NUMITER > 1), the multiple images at each position are first registered and then combined into a single image. The coordinates (as determined by the WCS keywords) of the first image at a given pattern position are used as a reference for the registration. The offsets to all other images at that pattern position are first computed by comparing their WCS data, and then refined using a cross-correlation technique, down to a level of 0.15 pixels. The cross-correlation technique employes an algorithm which minimizes the differences between fluxes in the images. The computed offsets, in units of pixels, are recorded in the output association table. After determining the relative offsets, the images are aligned using bilinear interpolation and are then combined on a pixel-by-pixel basis. The combined pixel values are computed as a weighted mean of all unflagged (i.e., DQ = 0) samples, using the input image ERR values as weights. If three or more samples are present, iterative -clipping is performed to reject outliers. The number of samples used at each pixel and the total integration time are retained.

Source Identification

The source identification step is used for excluding sources when the background in the images at each pattern position is estimated. The images at each pattern position are searched for pixels suspected to contain signal from a source. The median signal level in the image is computed and pixels that are more than 4.5 above the median are considered as candidates. Spurious results, such as pixels containing cosmic-ray hits, are filtered out by searching neighboring pixels and only retaining those candidates that have two or more neighbors that are also above the threshold. The DQ flag of the source-affected pixels is then set to 1024.

Background Estimation and Removal

The background signal is estimated and removed from the images at each pattern position. Two types of background are subtracted from the images:

  1. A constant background signal level, which is estimated from the images themselves.
  2. In principle, a two-dimensional residual background may exist due to spatial variations in the thermal emission of the telescope and instrument. Calnicb has a mechanism for removing this by subtracting the ILLMFILE reference image from each image. In practice, however, it does not appear that there are strong spatial illumination variations requiring such corrections, and therefore the ILLMFILEs used in the processing pipeline are dummies, with no effect on the data values. The step may also be turned off entirely by setting ILLMCORR to OMIT in the association table (by default, it is set to PERFORM, even though dummy files are used). In order to disable ILLMCORR, the keyword must be changed in the association table header itself, not in the primary image header of the association table FITS file. This must be done with the tables.parkey task, not with hedit. See the highlighted note at the end of section 3.5.2 for how to do this. Ordinarily, it is simplest to just leave ILLMCORR=PERFORM and use the dummy reference files.

The constant background signal level is estimated and removed as follows.

  1. With chop patterns, the median and average deviation of the signal in the image at each chop position is computed. In addition to excluding bad and source-flagged pixels, the calculation of the median also uses iterative sigma-clipping to reject outliers.
  2. With dither-only patterns, or with multiple-exposure single pointings, the median and average deviation of each target image is computed. The result for each image is compared to the background estimate provided by calnica, which is (in principle) stored in the BACKEST1 header keyword of each image. The value computed by calnicb is accepted if it is less than 5 deviant from that of calnica, otherwise the calnicb value is assumed to be biased by the presence of sources and the calnica value is substituted for it. Note, however, that normally the value of BACKEST1 would be populated by the BACKCALC step of calnica, which has never been implemented (see section 3.3). Therefore ordinarily BACKEST1 has value 0.0, and in this case the background value computed by calnicb is always used, unless the user has manually set BACKEST1 to some non-zero value.
  3. The global constant background signal is computed by taking the mean of the background values for each image, again using iterative sigma-clipping to reject outliers.
  4. The final mean background value is subtracted from all images (both target and background images, if present).
  5. With dither-only patterns, the user has the option of subtracting the individual background values computed for each image from themselves, rather than computing and subtracting a global mean background value. This option is controlled by the meanbkg task parameter for calnicb. The default value, "yes", indicates that the global mean is to be used.

Mosaic Construction

Mosaic (MOS) images are created for each independent pointing within the pattern. For example, a combination DITHER-CHOP pattern will produce one mosaic image out of the dithered pattern at each CHOP location on the sky. Each mosaic image is created as follows:

  1. The relative offsets between images within the mosaic are computed from their WCS information and refined using cross-correlation (as in the case of multiple exposures at each pattern position; see Combination of Multiple Exposures). The first image in the list for each mosaic is used as a reference image.
  2. An empty mosaic image is created with x and y dimensions large enough to encompass the maximum offsets in each direction.
  3. Pixel values in the mosaic image are populated by combining samples from overlapping images. The individual images are aligned using bilinear interpolation and the value at a given mosaic pixel location is computed from the error-weighted mean of the samples at that location. Samples flagged as bad are excluded and, if three or more samples are present, iterative sigma-clipping is used to reject remaining outliers. The number of samples retained for a given pixel and their total integration time is recorded in the SAMP and TIME images, respectively. If all samples are rejected for a pixel, the mosaic image SCI, ERR, SAMP, and TIME values are set to zero and a combination of all DQ flags is retained.

TOC PREV NEXT INDEX PDF
Space Telescope Science Institute
http://www.stsci.edu
Voice: (410) 338-1082
help@stsci.edu


Copyright  | Help  | Printable Page