Each adopted grating setting will require a flat field frame, combined from 10-40 individual flat field frames of the flat field lamp. Each frame should have a high signal level -- over 1000 counts per pixel but less than half-full-well to minimize residual dark current ghosting, especially on the new Aladdin II array.
Combination of the flat field frames is very similar to combining dark frames. I do two different things during image combination:
imarith flat4272 - dark15 flat4272
This subtracts the file dark15.fits from flat4272.fits, overwriting itself in the process. So far, so good.
Normalizing the Flat to Unity:
Now we need to normalize the flat field to about 1 to preserve photon counting statistics when applied to our data frames. Let's use imstat to get the median pixel value:imstat flat4272.fits[85:210,200:800]
The result is:
# IMAGE NPIX MEAN STDDEV MIN MAX MODE flat4273.fits 75726 3443. 247.4 -234.8 6437. 3408.Thusly, if we divide our combined flat field frame by 3443, we should get an image that is normalized to unity. Let's do that with imarith:
imarith flat4272 / 3443 flat4272
This divides the file flat4272.fits by 3443 and overwrites itself with the resulting image.
Removing the Broad Spectral Response:
This typically yields a "pretty good" flat field frame for your data. If you additionally want to remove the spectral response of the array from your flat field, you can use the response task from the twod --> longslit package. An example of editing the parameters for response is shown below:
This will take a 100-pixel strip in the middle of the slightly-tilted illuminated section of the array and fit a smooth polynomial to the response of the array as a function of wavelength, writing a response-corrected image to flat4272R.fits. When you run response, an interactive window will allow you to fine-tune the fit:
In this case (left), a 1st order spline was insufficient to fit the response of the data. A 7th order spline was selected by hitting : to get IRAF's attention, and then o 7 [enter] to change the order of fit and f to refit the data. Typically, 3rd-7th order is sufficient to fit the response; use the lowest order that reasonably fits the response. Remember, we only want to remove the slowly-varying spectral response, not the pixel-to-pixel variations (that would destroy the purpose of the flat field, after all).
N.B. Note! Since the lowest 16 pixels of the Phoenix array do not contain any data, you will want to remove these pixels from the fit. Move the cursor to this region and hit d to delete pixels from the fit until there are no more to delete. Then hit f again to refit the data.
Looks good. Hit q when you're happy with the results, and have a look at the results using display:
Constructing Dark Frames | Reduction Home | Selecting Files for Bulk Processing |