Reduction Procedures using IRAF: Preparing images for photometry

Note: Any page numbers refer to CCD reduction manual by Massey, et al

Change directory to /flattest or whatever directory that you would like to work in.

1) Use implot on flat image to confirm bias and trim values given in Step 2

Type:
implot b0025.imh
Look at left and right edges (remember to use e to expand these regions; r to replot full image) to determine what columns to keep (first pair of trim parameters) and the overscan region (first pair of bias parameters) to measure the bias offset. Type c to plot a column to determine the second pair of trim and bias parameters (top and bottom of portion of image to keep). Type q to exit implot.

2) Subtract columnbias and trim using noao.imred.bias.colbias

To load the package  noao.imred.bias.colbias, type at the 'cl' prompt:
cl> noao
cl> imred
cl> bias
Create a file list with the names of  all  images.
files *.imh > imlist
The routine, colbias, should appear as one of the available packages loaded. Type:
epar colbias
and modify the following parameters
input = @imlist
output = @imlist
bias = [1030:1042,2:1020]
trim = [10:1010,2:1020]
function = chebyshev
Remember to type 'control-d' to save changes.

Run colbias.
Continually hit return and q (in image window) to confirm.
 Note any images that look 'funny'.

3) Create master bias frame with package imred.ccdred.zerocombine

Create a file list with the names of  all of the bias frames.
files b* > biaslist
will write the names of all b-series files to the file 'biaslist'. Then use vi to delete names from list (i.e., filenames that are not bias images). Also, delete any image names that you determined were 'funny' in Step 2.  In the vi editor, use arrow keys to navigate and dd to delete a line. Type :wq to 'write/quit', i.e., to save file and quit. You can also use the pico editor by typing !pico filename.

Load  imred.ccdred (as described above) and epar zerocombine. Enter '@' and then the name of this file (@biaslist) in the 'input' entry. Leave the rest of the zerocombine options at default (page 13) With the default, the output master biasframe will be 'Zero'. Then run zerocombine to create master bias frame.

4) Subtract master bias frame (Zero) from all flat and data images

Copy the imlist to filelist (!cp imlist filelist) and edit filelist to remove the names of all
bias images and 'bad' images (again, see Step 2).

Use the imarith function (general image arithmetic function - in this case, subtracting each bias frame (Zero) pixel value from each image frame pixel value). epar imarith and set the following values:

operand1 = @filelist
op = -
operand2 = Zero
result = @filelist
Run imarith. This will subtract the image, Zero, from every image named in filelist, writing over the original image (result is the same as operand1)

5) Create master flat field.

Create file list containing names of flat field images. Type
cp filelist vflatlist
and use vi or pico to delete non-flatfield images. epar flatcombine with mostly default settings from page 20 except:
input = vflatlist
output = flatV
process = no
It might be a good idea to view each flat first before including them in the list. Run flatcombine to create master V-flatfield 'flatV'.

6) Normalize flat using imstat and imarith.

At the cl> prompt, type:
imstat flatV fields="image,mode"
to determine the mode of the pixel values (most frequently occuring value). I got 13288 for the flat field images that I used - yours may be different. Normalize the pixel values by typing:
imarith flatV / 13288 flatV
Take a look at final 'flatV' with disp and implot (pixel values should hover about 1)

7) Perform flatfielding using imarith.

Make list of object images (files tra* > objlist) or just use image name (if only one such as a0041.imh). Divide each image by the master flatfield (flatV):
imarith @objlist / flatV @objlist
Do the images look any cleaner than when you started? (i.e.,  do you really believe that the process worked?). You might compare one of the finished products with the original image.