HDF Cosmic Ray Rejection:

Cosmic ray detection was performed in stacks with the same dither position. A new version of the CRREJ task in STSDAS was used, which is capable of handling different exposure times and time variable background levels. The task uses a noise model and calculates the expected noise for each frame from the measured signal level and the known detector read noise. The sky level is measured by finding the mode in the histogram with bin sizes of 1 ADU.

At each pixel CRREJ looks at the stack of frames and selects some initial pixel value, which can be the minimum or the median across the stack. Because even with 7 frames or so the median can be corrupted by cosmic rays, we have used the minimum which should be very rarely corrupted by cosmic rays. One disadvantage of the minimum is that occasionally a data drop out may be picked as the minimum. Another disadvantage is that the exposure times in a stack vary a lot. So when images are scaled to the same exposure time the amplitude of the noise is much larger those with short exposures times than in those with long exposure times, which means they are more likely to populate the extremes of the distribution, and are therefore more likely to be chosen as the minimum. Then when measuring the difference between the initial guess and the individual pixel values, the fact that the minimum is lower than normal has to be taken into consideration when defining the CR detection threshold. This has not been done perfectly, but seems to work reasonably well. This all matters only in the first iteration. On subsequent iterations the average is used. Pixels are rejected which deviate from that mean and the remaining pixels are averaged together forming the base value which enters the following iteration.

The output of CRREJ is a cosmic ray mask for each input image. These masks will be made available in a highly compressed form.

The parameters used for CR detection are stored in the headers of the combined stack files. The rejection was done using three iterations, the kappa-sigma clipping thresholds were 6, 5, and 4 in these iterations. When a pixel is flagged as cosmic ray all pixels in some neighbourhood around it are considered suspect. The relevant parameter is called radius in CRREJ, and a radius of 1.5 was used, i.e. the full 3x3 neighbourhood of a given pixel. For these suspect pixels, the thresholds are multiplied by a parameter PFAC which can be anything from zero, meaning that all suspects are automatically rejected, to one. We have chosen PFAC=0.5. The suspect pixels are therefore subject to clipping at the 3 sigma, 2.5 sigma and 2 sigma level.

All these input parameter values have been experimented with extensively. The pixel values for pixels thrown out by a PFAC=0 choice, but not by PFAC=0.5 choice were compared. It was found that the average value of these pixels is 1/2 ADU higher than the sky. So there is some CR contamination in these suspect pixels. However with PFAC=0 the number of additionally rejected pixels would large. With PFAC=0.5 only 2.5% of the pixels are typical rejected as CR-hits, compared to 7.5% with PFAC=0. This means if a stricter contamination control would be exerted, one would reject a large number of pixels, which would entail a higher noise level. The choice is between accepting a little higher corruption in the data versus cleaning those pixels out at the expense of higher noise. The 1/2 ADU is a fairly low level and puts a some extra flux and structural noise into the combined frame, but this is expected to average out to a small contribution over many frames.

With the chosen PFAC=0.5 parameter setting roughly 2.5 % of all the pixel values are rejected due to suspected CR hits, entailing an overall signal-to-noise decrease by about 1.25 %. There is some additional noise contribution due to undetected CR hits, but its amplitude can presumably assessed only by doing some realistic simulations.

Copyright © 1997 The Association of Universities for Research in Astronomy, Inc. All Rights Reserved.

Harry Ferguson ferguson@stsci.edu 1/14/96