next up previous contents
Next: About this document ... Up: manual Previous: The Astronomy Library and


Using IRAF on a UNIX Workstation


(Rev. August 06, 2007)

Starting IRAF

Once you have logged in to one the Department of Astronomy's UNIX workstations, you will be able to use the IRAF software package to reduce and analyze your CCD data. The computer account you are using should already be set up to run IRAF. If it is not, see the department's computer guru, Howard Powell, or your TA for help.

To begin using IRAF, do the following:

  1. Type cd iraf to move to the iraf setup directory.

  2. Type cl to begin IRAF (cl means command language).

  3. In another window, type: ximtool &. This will start an image tool window.

  4. (To exit IRAF, type logout, or lo for short.)

Once you have started IRAF, the prompt in the IRAF window will always be two letters followed by a ``$>$''. For example, the prompt will be cl$>$ after start up. These letters change depending on which IRAF package was last loaded. Note that once an IRAF package is loaded, you may access tasks within that package even if other packages have been loaded afterwards.

Note that it is not possible to give a thorough treatment of the IRAF package here, but only an introduction. To learn more about any particular task taskname, you may type help taskname at the IRAF prompt. To find out which tasks have been loaded at any particular time, you may type a ``??" at the IRAF prompt. IRAF is a huge program with many tasks and add-on packages. Only a small subset of the entire IRAF behemoth is covered here.

FITS vs. IRAF format

IRAF will, by default, convert all images into a standard format only compatible with IRAF. It will work with FITS images, although this does entail some risk as the FITS kernel is relatively new. All the commands described below are designed to work with FITS images. You simply replace ".imh" and ".pix" with ".fits".

By default, IRAF will convert your image from fits to IRAF when any operation is applied ot it. Suppose your images have names like ``ccd117.fits". Any operation will convert the image into the standar IRAF format ``ccd117.imh" and ``ccd117.pix".

In this context, ``.imh" is the suffix specifying the IRAF file (meaning ``image header"). At this point it is necessary to make brief mention of the IRAF file format. IRAF was developed at a time when disk space was hard to come by but CCD images had already become reasonably sized. It was common at this time for there to be a ``large-sized" disk shared by all users in a networked environment. The philosophy of IRAF was a compromise between the fact that users would want to have their images arranged within their personal directory structure, and the problem that these disk areas were usually too small to handle the images. Thus, each IRAF image has two files:

  1. A ``.imh" image header file that is small and that contains header information about the image (dimensionality, array size, number of bytes per pixel, etc.), as well as a pointer to where the real pixel data is to be found, and

  2. The ``.pix" file which contains the meat of the image, the large file of pixel values.

Unfortunately, in spite of the fact that disks are much larger now, the versions of IRAF prior to 2.11 are wed to this dual file format and it is important to be mindful of it. Two rules must always be followed when dealing with IRAF images:

  1. All operations you do with IRAF tasks must act on the ``.imh" images (IRAF keeps track of the real manipulations with .pix files), and

  2. Never perform UNIX operations on IRAF images that will change the directory locations of the ``.imh" and ``.pix" files. In general, it is not a good idea to do any UNIX operations on IRAF files; however, most UNIX operations (e.g., mv, cp, rm) have IRAF counterparts (e.g., imrename, imcopy, imdelete) that act on the coupled IRAF files. Always use the IRAF tasks for operations on images.

You may want to leave images in FITS format so that they can be operated on by other programs, such as IDL. To do this you need to type:

cl> reset imtype="fits"
cl> flpr
cl> reset imextn=".fits"

You can also add the reset commands to your program to have it be the default.

Common IRAF Tasks

We now briefly turn to the most commonly used IRAF tasks that you will want to use. Again, read the help files of these tasks to learn the full capabilities. For each IRAF task, there are two sets of associated parameters: hidden parameters which, once set, remain held until changed explicitly, and unhidden parameters which must be set every time the task is invoked. The list of unhidden and hidden parameters for a task may be seen by typing

cl$>$ lpar taskname

The hidden parameters are the ones shown in parentheses when you do an lpar command. Unhidden parameters may be typed on the command line, but if not included there, you will be asked for them by the program. For example, to display an IRAF image in your imtool window, use the display task:

cl$>$ display ccd117.imh

Note, if you simply type

cl$>$ display

you will then be asked

image to be displayed ():

Anything written in the parentheses after such a question is considered a default, and can be accepted with a simple $<$cr$>$. The default is generally related to the last time you successfully invoked the same command. For example, if you had previously display an image ``ccd116.imh", you would have been asked

image to be displayed (ccd116.imh):

Hidden parameters may be changed in several ways. At any point you may change a hidden parameter at the IRAF command line, as in the following example:

cl$>$ display.fill=yes

In this example, the hidden parameter ``fill" of task display is set to ``yes" and will remain so until changed again. The display.fill option tells IRAF whether to squeeze down an image to fit it entirely into the full display region of ximtool if set to yes, or to display only the central portion of the image with a 1:1 mapping of pixels into the 512x512 ximtool display area.

When many parameters need to be changed for a task, use the epar command, e.g.:

cl$>$ epar display

which will then bring up the full menu of both hidden and unhidden parameters. Use the $<$down$>$ or $<$up$>$ arrows to examine the parameters. To change one, move to it with the $<$up$>$ or $<$down$>$ arrow, type in the new value, then move on. You do not need to type a $<$cr$>$ with each new entered value. When you are finished editting parameters, exit with a control-$<$d$>$.

Alternatively, you could have changed the hidden parameter at the invokation of the command display:

cl$>$ display ccd117.imh fill=yes

but note that in this case the hidden parameter is changed only for this single invokation of the display command, and will revert back to the default fill=no when the command is finished, unless it had already been previously set to fill=yes.

Here is a list of other IRAF tasks you may find useful (note: you need only type an IRAF command to the point that the typed letters specify a unique IRAF task):

Finally, a word on image sections. Any of the above IRAF operation may be performed on image sections. In IRAF, the x-dimension of an image is specified as columns, and the y-dimension is specified as rows (or lines), and described always in the specific order [columns, rows]. For example, if you do an imhead on an image, you will get back the dimensions of the image as, e.g., [2048, 2048]. But you may also operate on specific sections of images by specifying rows and columns explicitly, and with a ``:" as the delimiter for ranges. For example, to display only columns 101 to 200 and rows 301 to 400 of image ccd117.imh, you would type

cl$>$ display ccd117.imh[101:200, 301:400]

and to copy line 233 of image ccd117.imh into a separate image, ccd117.233.imh

cl$>$ imcopy ccd117.imh[*,233] ccd117.233.imh

where here the ``*" wildcard specifies all columns. In most operations of IRAF, the ``.imh" is assumed, so that

cl$>$ imcopy ccd117[*,233] ccd117.233

would operate identically to the above command.

Image Reduction in IRAF

This section of the IRAF manual is intended to provide students with a standard method for reducing CCD images. Please note that the manual is not exhaustive. For a thorough treatment of the subject, refer to Phil Massey's A User's Guide to CCD Reductions with IRAF on the NOAO web page or the printed version in Kerchoff 313.

The images that you will obtain from the department CCD's are not perfect. They contain various systematic effects which distort the images. The removal of these systematic effects, achieved by comparison with calibration images, is the process of reduction. This section will detail how to remove the overscan, trim an image, subtract the bias, subtract the dark current, divide by the flat field, and divide by the illumination. The result should be a nice clean flat image.

The entire process of reduction hinges upon your having a set of ``calibration images." These images, itemized below, are what you will use to calibrate the object images--the picture that you want to process. Read this list before observing.

Bias Frames:
frames taken with a zero exposure time with the shutter closed. You should have 10 of these for each night that you observed.

Dark Frames:
frames taken with the shutter closed. These monitor the induce thermal current of the chip. The ST-8 and smaller CCD's will take darks automatically at your request. These are thermo-electrically cooled CCD's and the dark current is substantial. You will need to actively take dark frames for each combination of temperature and exposure time. The Fan Mountain CCD is liquid nitrogen cooled and has negligible dark current. You should only need one long dark frame per observing run as a check on the dark current.

Flat Fields:
images of a uniformly illuminated screen (also called dome flats). You need to do at least 10 (preferably more) for each filter that you used (B,V,R, etc.). If you remove the CCD from the telescope or reposition it or the filters, you will need to take an entirely new set of flat fields.

Sky Flats:
also called illumination images or twilight flats. These are exposures of the twilight sky. Your data images can also be included in this set, providing you have a large number of frames with plenty of sky (i.e., your target objects are small). You should have about 10 illumination images in each filter. Again, if you remove the CCD from the telescope or reposition it, you will need to take an entirely new set of flat fields.

Procedural Overview

A short description of the image reduction process follows.

Overscan and Trim Correction:
the overscan strip of the CCD is used to correct voltage drifts in the readout amplifier. Once corrected, the image is trimmed to revmoe the overscan region around the image as well as any bad edges.

Bias Correction:
the pixel-to-pixel DC voltage level inherent in the chip is subtracted.

Flat Field Correction:
the image is divided by a uniformly illuminated image to correct for pixel-to-pixel variation in quantum efficiency.

Dark Correction:
the dark current is subtracted from the image.

Illumination Correction:
the image is divided by a combination of sky images to correct for wavelength dependent low frequency errors in the dome flats.

The CCDRED Package

To load the CCDRED package, start up IRAF (by typing cl), type imred to load the image reduction package then ccdred. The procedures you will use within the CCDRED package are:

It's probably wise to start off with all CCDPROC's options turned off. Edit the CCDPROC parameters (used eparam to start, :qw when done) until they read:

images  =                       List of CCD images to correct

(ccdtype=                     ) CCD image type to correct
(maxcac=                     0) Maximum image caching memory (in Mbytes)
(noproc =                   no) List processing steps only?
(fixpix =                   no) Fix bad CCD lines and columns?
(oversca=                   no) Apply overscan strip correction?
(trim   =                   no) Trim the image?
(zerocor=                   no) Apply zero level correction?
(darkcor=                   no) Apply dark count correction?
(flatcor=                   no) Apply flat field correction?
(illumco=                   no) Apply illumination correction?
(fringec=                   no) Apply fringe correction?
(readcor=                   no) Convert zero level image to readout correction?
(scancor=                   no) Convert flat field image to scan correction?
(readaxi=                 line) Read out axis (column|line)
(fixfile=                     ) File describing the bad lines and columns
(biassec=                     ) Overscan strip image section
(trimsec=                     ) Trim data section
(zero   =                     ) Zero level calibration image
(dark   =                     ) Dark count calibration image
(flat   =                     ) Flat field images
(illum  =                     ) Illumination correction images
(fringe =                     ) Fringe correction images
(minrepl=                   1.) Minimum flat field value
(scantyp=            shortscan) Scan type (shortscan|longscan)
(nscan  =                    1) Number of short scan lines
(interac=                   no) Fit overscan interactively?
(functio=            chebyshev) Fitting function
(order  =                    5) Number of polynomial terms or spline pieces
(sample =                    *) Sample points to fit
(naverag=                    1) Number of sample points to combine
(niterat=                   15) Number of rejection iterations
(lowrej=                    3.) Low sigma rejection factor
(highre=                    3.) High sigma rejection factor
(grow   =                   1.) Rejection growing radius
(mode   =                   ql)

CCDLIST--What do I got?

Normally, if you want to know details of an image, you use the IRAF command IMHEAD. IMHEAD will reveal exposure time, filter number, and the processing state of an image. For example, typing imhead ccd6034 gives the following output.

ccd6034[2043,2047][real]: Sa184-9

    No bad pixels, no histogram, min=unknown, max=unknown
    Line storage mode, physdim [2048,2047], length of user area 1013 s.u.
    Created Wed 23:19:46 25-Jun-97, Last modified Wed 23:19:46 25-Jun-97
    Pixel file "HDR\$pixels/ccd6034.pix" [ok]
    New copy of ccd6034.imh
    New copy of ccd6034.imh
    CHIP    = 'TEK5'                /  DETECTOR NAME
    TEL     = 'LCO-40'              /  TELESCOPE NAME
    UTSTART = '03 44 00'            /  UT OF START FROM PC
    UTEND   = '03 54 03'            /  UT OF END FROM PC
    FILTERP =                    4  /  FILTER POSITION
    FILTER  = '4'                   /  FILTER NAME
    CCDPICNO=                 6034  /  FRAME NUMBER OF IMAGE
    EXPTIME =                  600  /  ACTUAL INTEGRATION TIME (S)
    GAIN    =                    2  /  GAIN NOT NEC. E/DN
    LOOP    =                    1  /  LOOP SIZE
    LOOPCTR =                    1  /  LOOP COUNTER
    DATE-OBS= '13Jul96'             /  LOCAL DATE OF OBSERVATION
    RA      = '000000.0'            /  RA OBS-ENTERED
    DEC     = '000000'              /  DEC OBS-ENTERED
    IMTYPE  = 'object'              /  IMAGE TYPE
    TRIM    = 'Jun 24 18:24 Trim data section is [1:2043,1:2047]'
    OVERSCAN= 'Jun 24 18:24 Overscan section is [2050:2064,1:2048] with mean=696
    ZEROCOR = 'Jun 24 18:24 Zero level correction image is /gonzo/starcounts/c40
    FLATCOR = 'Jun 24 18:24 Flat field image is /gonzo/starcounts/c40jul96/dflat
    CCDSEC  = '[1:2043,1:2047]'
    CCDMEAN =             1567.705
    CCDMEANT=            551748001
    CCDPROC = 'Jun 25 23:20 CCD processing done'
    ILLUMCOR= 'Jun 25 23:19 Illumination image is /home/didjeridu/gonzo/starcoun
    ITIME   =              602.087

Note the sections marked OVERSCAN, ZEROCOR, etc. These detail the processing history of the image. The image listed above has had corrections for trim, overscan, bias, flat field and illumination applied. Flipping through a few dozen image headers can get tiresome though, so the process CCDLIST will produce a list of the images in the current directory along with their processing history. You can then type ccdlist ccd*,


which lists the image name (ccd6031), the size of the image (trimmed to 2043x2047), the pixel status (real), the image type (none), the filter (BVRI, set by a translation file), the processing history (OZTFI) and the image name (SA184-9). The processing history letters stand for:

The pixel status and image size are read by CCDLIST. Be aware that IRAF automatically converts images to real (floating point) status when running CCDRED processes, which can double the amount of disk space they take up. The image type, filter, and name must be set in the image header.

Test Images

You don't want to apply any image correction without checking its affects on your images. I usually will copy several CCD frames of various types (a bias, a flat, a few images) into test images (test1, test2, etc.). When I think I have a correction working properly, I apply it to the test images and make sure the results look nice (the eye is very good at this sort of thing) before applying the correction to the entire data set. Go through your data set and select out several images and use the IMCOPY command to copy them into test images.

The Log File

It is generally wise to turn on the logfile option in the CCRED processes. The log file will record all the reduction steps you take. This can be very valuable later for reconstructing the reduction when you realize that you screwed up.

To use the logfile, set the logfile parameter in any procedure you use to the name of the file you want. Generally, we use the unimaginative title logfile.

Trimming the Image and Correcting the Overscan

Not all images require trimming and overscan correction. In our department, only the Fan Mountain CCD has an overscan. Users of the ST-8 and other CCD's can skip this section.

The Fan Mountain SiTE chip reads out a strip of constant signal (16 to 32 pixels) after each CCD line. Theoretically, this should produce a broad line of constant flux on one edge of your chip. In practice, changes in the voltage of the CCD readout amplifier will cause the signal to vary slightly. Overscan correction fits a function to this strip and thus corrects for voltage variations.

When you trim an image, you cut out the sections that are not useful. The overscan section is not useful once you've applied the correction, so you can deep-six it. Sometimes, the first or last line in a CCD images will also be useless. It is usually best to do trimming and overscan correction at the same time.

The first thing to do is to use IMPLOT to determine which regions of the chip correspond to the overscan and which regions need to be trimmed out. It is probably wisest to do this with flat field frame.


The command implot ccd6034 will bring up a plot of the middle line of your CCD chip in a separate window. You probably want to average over a few lines, so type ``a:50" in the graphics window to average over 50 lines. Now this plot (Figure 1) will show variations in brightness across these lines. If you used an image frame, you will see large bumps from stars. At the edge of the chip, the signal will fall off dramatically. You will see a spike at the end of the image section and then a drop to a constant level. This constant level is the overscan strip. The spike is garbage.

Position the cursor over the edge of the image and hit ``e" to expand the view. You want to get a very accurate estimate as to where the overscan region begins. On the image in the figure, the overscan strip is from column 2050 to 2080. Columns 2046 to 2049 are probably garbage and should be cut. You also want to check the other end of the line to make sure you don't need to cut out low-numbered columns. In this image, they're fine.

You also want to check in the $y$ direction (column) to make sure you don't need to trim out a few lines. In this image (Figure 2) the $y$ direction is fine. Be aware of what the limits of your chip are. If your chip is $1054 \times 512$ for example, the signal will go to zero after 512. And remember that not all chips have an overscan region.

Open CCDPROC. IRAF uses a notation of [x1:x2,y1:y2]. There are four parameters you need to change. Set overscan and trim to yes. Set trimsec to the area of the image you wish to keep. This is a backwards way of trimming, but it's the way IRAF is wired. Set biassec to the overscan strip region. In my image, the overscan is over the entire range of $y$ and from 2050 to 2080 in $x$. Note that it is generally a good idea to avoid the very edge of the image, as well as near column 2048 where the amplifier is ramping down. I want to trim out everything past line 2046. You will also need to fit the overscan region, so change interactive to yes. So my parameters will be:

(oversca=                  yes) Apply overscan strip correction?
(trim   =                  yes) Trim the image?
(biassec=   [2050:2080,1:2048]) Overscan strip image section
(trimsec=      [1:2046,1:2048]) Trim data section
(interac=                  yes) Fit overscan interactively?

Now run CCDPROC on your test images. The only one on which the overscan correction will show is the bias image. Display the unprocessed bias image in one window of XIMTOOL. Then run CCDPROC on its test copy.

Typing ccdproc test1 will begin the processing of your image. Since you have set the overscan fitting to interactive, you will be presented with a screen (Figure 3). This will show the variations in the overscan region. They are usually very chaotic but there is an overall trend in the data. It is this broad trend you wish to pluck from the overscan. In these first few images, you will actively fit the overscan. Once you have decided on a function, you will apply it non-interactively to future frames.

Within the overscan noise, you should see a solid curve. This curve represents the presently fit function. Use f to refit and plot the function until you do see it.

The process of fitting an overscan region is quite complex. You can change the function (spline3 functions do well in general), the order, or the rejection parameters with a colon command (e.g., :order 2 would change the function to second order), then type f to apply the change. Each overscan is unique but there are a few ideas that you should stick to:

Once you are done fitting the overscan, the image will be trimmed. Display the test image in the second window on XIMTOOL. You should see changes: (1) the image will be smaller, with the edges trimmed off, (2) broad horizontal bands of brightness across the image should be smoothed out. If the brightness bands are not taken care of or new ones appear, you need to try again by recopying the original image onto the test image and CCDPROCing again. Again, be aware of the scale. A brightness fluctuation of half an ADU is no big deal.

Once you have decided on good overscan parameters and a good trim section, turn the interactive mode off and run CCDPROC on your bias images. You could now apply it to every image in your data set, but that might double the size of every image--a big problem if your computer disks are cramped.

Bias Combining and Subtracting

CCD images have a bias in them--a reflection of the DC bias voltage applied to the pixels. You need to subtract this out. The overscan correction will subtract out the bulk of it for the Fan Mountain CCD, but one more step is needed.

Important Note: If your data was taken over several nights, you will need to process each night's bias separately. For example, if you observed on two nights, you should have taken a set of bias frames each night. When you combine them, you should combine the biases from night one into one bias image (call it ``Night1Bias") and the biases from night two into another (``Night2Bias"). Keep this in mind while reading the rest of this section.

In this section, you will learn to combine images. The bias level on any chip is, by its very nature, noisy. You can improve your image of the bias (and thus, your data) by averaging together a number of bias frames.

The IRAF procedure IMCOMBINE is the do-all software for image combining. The default parameters of IMCOMBINE are listed below:

input   =                       List of images to combine
output  =                       List of output images
(plfile =                     ) List of output pixel list files (optional)
(sigma  =                     ) List of sigma images (optional)
(logfile=              logfile) Log file
(combine=              average) Type of combine operation
(reject =                 none) Type of rejection
(project=                   no) Project highest dimension of input images?
(outtype=                 real) Output image pixel datatype
(offsets=                 none) Input image offsets
(masktyp=            none) Mask type
(maskval=                   0.) Mask value
(blank  =                   0.) Value if there are no pixels
(scale  =                 none) Image scaling
(zero   =                 none) Image zero point offset
(weight =                 none) Image weights
(statsec=                     ) Image section for computing statistics
(expname=                     ) Image header exposure time keyword
(lthresh=                INDEF) Lower threshold
(hthresh=                INDEF) Upper threshold
(nlow   =                    1) minmax: Number of low pixels to reject
(nhigh  =                    1) minmax: Number of high pixels to reject
(nkeep  =                    1) Minimum to keep (pos) or maximum to reject (neg)
(mclip  =                  yes) Use median in sigma clipping algorithms?
(lsigma =                   3.) Lower sigma clipping factor
(hsigma =                   3.) Upper sigma clipping factor
(rdnoise=                     ) ccdclip: CCD readout noise (electrons)
(gain   =                     ) ccdclip: CCD gain (electrons/DN)
(snoise =                   0.) ccdclip: Sensitivity noise (fraction)
(sigscal=                  0.1) Tolerance for sigma clipping scaling corrections
(pclip  =                 -0.5) pclip: Percentile clipping parameter
(grow   =                    0) Radius (pixels) for 1D neighbor rejection
(mode   =                   ql)

You will have to set the parameters rdnoise and gain from the statistics for the chip. These should be available from the course instructor.

There are several ways to combine. What IRAF does is create an image in which each pixel is the average or median of the corresponding pixels in each input frame. The combine parameter defaults to average. This is probably acceptable.

One of the more important aspects of combining is rejecting pixels. Occasionally, a pixel is hot or is struck by a cosmic ray. You want to have IRAF reject pixels that are far removed from the average. You can reject pixels many ways - sigclip, avsigclip. The best, generally, is ccdclip, which uses the noise parameters of your CCD to decide what to reject. The default values for ccdclip are usually acceptable.

You should inspect your frames visually to make sure that they are all basically the same. You may also use the IRAF process imstat to get statistics on your frames. The average or midpt of each frame should be about the same.

Once you've set your parameters and rejected any bad frames, it's time to combine. Type IMCOMBINE. IRAF will ask you what images you want to combine. You can either manually list all the images (e.g., ccd101, ccd102, ccd103 . . . ) or you can create a list.

Creating a list is simple and is very helpful when your are combining a large number of images. You simply create a text file that lists the images you want. You can even add pathnames if you want to combine images from different directories. For example, I might create the list Biaslist which would have the contents:

\ bias \ ccd105
\ bias \ ccd106

When IRAF asks you for the images to combine, you respond with @filename. In the example above, I would respond with @Biaslist. IRAF will also ask you for the combined file name. Keep it simple. Something like ``Bias".

Visually inspect your combined bias frame. It should resemble your other bias frames, only with a much smoother surface. If you are unsatisfied, you can try tinkering with the rejection parameters or switching the combine function to median.

Once you are happy with your bias frame, apply it your test, dark and flat field frames. Go into CCDPROC and change zerocor to yes and set zero to your combined bias image (``Bias" in this example). Leave the trim corrections and overscan set, if you used them. You always want to be certain that your images have had all the necessary corrections applied.

Remember: If you observed over several nights, you need to match the right bias to the right data. Images taken on the second night of observing should be bias subtracted with the combined bias frame from that night (``Night2Bias", using the example at the beginning of this section).

Dark Combining and Subtraction

Dark current is the data that the CCD receives from itself. The longer a CCD is exposed, the more electrons is accumulates, which are added to the image. Dark frames are becoming rarer and rarer. The Fan Mountain CCD is cooled so that it does not really need them. The ST-8 and other chips can and should have their dark current subtracted at the time of observation as their current is fairly high. However, should you need to process dark frames separately, this will guide you through the process.

Essentially, you will do the same thing you did with the bias frames. There is one crucial difference. The level of dark current in each frame is directly proportional to the exposure time. Since you may have various exposure times, you should scale the dark frames by this. The process DARKCOMBINE does this automatically. DARKCOMBINE essentially runs IMCOMBINE in such a way as to create a combined dark. Be sure to change the rdnoise, gain, combine and reject parameters appropriately. Combine your dark images into a frame called ``Dark".

Once you have the combined dark frame, run CCDPROC again, this time on your test and flat field frames. Set darkcor to yes and dark to the name of your combined dark frame.


You may take flat fields on the 26-inch and 40-inch by illuminating the surface of the dome and pointing the telescope at it. The 8-inch and 10-inch Meades will never have a flat field screen. If you are using these telescope, you may skip to the section on illumination correction.

CCD chips do not respond uniformly to light. Some sections of the chip are more responsive to light than others. This is called a ``flat-field" effect as it is most easily exemplified by showing that a uniformly illuminated surface will not appear to be so on the uncorrected CCD frame. To correct for this, you take images of a flat surface (a white screen), combine them, and then divide all your images by the combined flat. Note that the flat field is different for each filter since pixel response is wavelength dependent. Thus, you should start out by dividing your flat field images into directories, one for B filter i mages, one for V, etc. This will help you keep them separate. After you have separated the images, visually inspect them to make sure they look alike. Exposure levels may vary from frame to frame.

Once again, you will use IMCOMBINE to add together the flat field frames in each filter. You should combine them into something easy to recognize, e.g., ``Bflat" for the B filter flat fields. There is one twist. Your flat fields will not have the same level of exposure. Some recommend scaling them by their exposure time, but I have found this to be ineffective as the lighting level on the flat field screen can change. You should change the scale parameter in IMCOMBINE to median.

Flat fielding is the second trickiest part of image reduction. When you are finished, apply the flat field to a test image in that filter using CCDPROC, setting flatcor to yes and flat to the name of your image. Display the test image and its unprocessed original in XIMTOOL. You should note a marked difference between them. The flat field correcton is the most dramatic and most obvious correction to an image that can be applied. There may still be a degree of non-flatness about the field, which will be corrected by illumination correction.

Once you are satisfied with the flat field correction, apply it to your test images and all of your data of that filter with CCDPROC. Then go onto the next filter and the next until all your data is flat-fielded.

Illumination Correction

We are now at the last and trickiest part of image reduction--illumination correction. We do illumination correction for two reasons. First, sometimes a flat field is not available. The only flat field that can be found is the sky itself. Second, the flat field is not always evenly illuminated by the flat field lamps. Flat field lamps are not the same color as the night sky - and the residual color affects the image at low frequencies. Illumination correction removes these effects as both depend on one basic fact - the only uniform, evenly illuminated surface is the sky. Of course, the sky usually has stars and galaxies in it. We'll have to get rid of them.

The simplest way to produce an illumination flat is to use imcombine to add all your images together in each filter. Thus, stars and galaxies will be rejected when you average the CCD frames.

At this point, every image you have should have all the corrections except for illumination applied to them. You now want to go through your entire data set, image by image. You want to make a list, one for each filter, of the images that are ``good" for illumination correction. Bad images are those which have extremely bright (and large) stars within them or images with short exposure times. Generally, you want the sky level to be fairly high. Twilight flats are almost always acceptable.

Now, you should put the name of each image in a list file, as I suggested with the bias frames. The list should be selective by filter. For example, the list of good sky images in B filter might be called Billumlist and might have the contents:

\ f40 \ ccd1062
\ f40 \ ccd1064

Now you will run IMCOMBINE on this image list (giving IRAF the name @Billumlist) when it asks for the combine list). The parameters you used for flat-fielding should be acceptable. The output name should be something like Brough, as this is a rough sky flat, not one smoothed by the process detailed below.

Once this image is produced, inspect it. It should produce a nice smooth image that will correct the residual flat-field on your images. Sometimes, I will simply use this image as my illumination correction (all you need do is used HEDIT to add the keyword MKSKYCOR to its header). However, it is usually wise to smooth the image with MKSKYCOR.

If your combined sky flat shows bright blobs in it, you probably need to go back and eliminate an image with a bright star in it. Sometimes, you may have to mask out the stars in an image to get a good combined image. I will not detail the masking process here.

MKSKYCOR is an IRAF procedure that will take a combined sky frame and apply a boxcar smoothing technique. It is very important that you eliminate any bad columns at this point as they will cause problems with smoothing. The process FIXPIX or IMREPLACE will achieve this. I will not detail the process here.

The default parameters of MKYSKYCOR are generally poor for large chips. Change them to read:

input   =               Brough  Input CCD images
output  =              Bsmooth  Output images (same as input if none given)
(ccdtype=                     ) CCD image type to select
(xboxmin=                   3.) Minimum smoothing box size in x at edges
(xboxmax=                 0.05) Maximum smoothing box size in x
(yboxmin=                   3.) Minimum moothing box size in y at edges
(yboxmax=                 0.05) Maximum moothing box size in y
(clip   =                  yes) Clip input pixels?
(lowsigm=                  2.5) Low clipping sigma
(highsig=                  2.5) High clipping sigma
(ccdproc=                     ) CCD processing parameters
(mode   =                   ql)

Now run MKSYCOR on your unsmoothed image Brough and produce a smooth image Bsmooth. Inspect it. Your image should be a nice clear pattern. If you find small bright or dark rectangles, that is the result of bad pixels contaminating the sample. You need to eliminate them.

Once you've finalized an illumination image, apply it to your test images in that filter by setting illumcor to yes and illum to your image name. Your images should now be smooth with little variation in the sky across the chip. Once you are satisfied, apply the correction to all the data in that filter.

Now you've got a reduced data set. Your next tasks will be to calibrate and analyze your images. Always make sure that photometric standard star frames are reduced identically to things you want to calibrate.

next up previous contents
Next: About this document ... Up: manual Previous: The Astronomy Library and

[an error occurred while processing this directive]