instruments are occasionally subject to scattered earthlight which enters when the telescope is pointing near the bright earth limb. This results in an elevated background level, which does not necessarily illuminate the detector in the same way as the sky does, and thus does not flat field away properly. For NICMOS MULTIACCUM observations, scattered light during a portion of the exposure (usually either the beginning or the end) will also cause the signal level to accumulate in a non-linear way with time, i.e. either with an initial or final “ramp-up” where the scattered light elevates the count rate for some of the readouts. This can cause problems when the calnica
CRIDCALC routine fits a linear function to counts vs. time, triggering the rejection algorithm for some pixels and not others, and resulting in erroneous slope fits (and hence, incorrect derived count rates) for some pixels.
Fortunately, for a MULTIACCUM observation, one can take advantage
of the time resolved nature of the data to exclude individual readouts where scattered light contaminates the data. As an example, let us look at one data set where scattered light plays a role. In this example, we will also use some of the tools in the stsdas.hst_calib.nicmos
package which are described in more detail in Chapter 5
. First, we will partially process the image through calnica
, skipping the UNITCORR, FLATCORR and CRIDCALC steps. The resulting *_ima.fits
image is thus in units of counts, not countrate. Next, we use the sampdiff
task to plot the median counts in each IMSET of the image vs. the sample time.
The upturn in the counts during the last few readouts indicates the
presence of scattered light at the end of the exposure. It is sometimes easier to see the effects of scattered light if you look at the “first differences” in an image, i.e., the difference
between each readout and the preceding one. In that way, you see only the counts that were accumulated during that readout sample, and not the cumulative sum of everything that came before. This can be done using the task sampdiff
in the nicmos
package (again, see Chapter 5
The easiest and safest way to eliminate the effects of scattered light is to
discard the affected readouts before fitting with CRIDCALC to compute the count rates and identify the cosmic rays. This will cost you part of the exposure time in your image, but will eliminate the elevated background, the uneven illumination, and problems resulting from incorrectly fit count rates and accidental triggering of the CRIDCALC cosmic ray rejection. This can easily be done by editing the data quality arrays in the DQ extensions of the affected images, setting them to some non-zero value (8192 is a good choice, as it is not otherwise used as a DQ flag value for NICMOS). This will cause CRIDCALC not to use those imsets when fitting a slope to counts vs. time to derive the count rate. You can edit these in the raw data frame and start over with the processing, or (in the example we are using here) in the partially processed frame, and then complete the processing using nicpipe
. For our example, we might continue in the following way. We want to exclude the last three readouts from further processing. Remember that NICMOS imsets are stored in reverse order in the multiextension FITS file, i.e., [SCI,1] is the last readout, [SCI,2] the next to last, etc.
The end product will be called n4ux11ufq_imaflag_cal.fits
, and should be free of scattered light, albeit with a somewhat shorter effective exposure time. The actual exposure time used per pixel can be determined by looking at the [TIME,1]
array of the final, calibrated image.