This page will take you through the procedures step by step, referring to examples in the User's Guide. If you follow the examples carefully, you should be able to reduce your data in a few hours.
  Important Note: All of the data reduction documentation refers to images explicitly in IRAF's "imh" format. If you have decided to do all of your reduction in FITS format, you should make sure you have configured your login.cl file as recommended, and you should substitute ".fts" for ".imh" wherever it appears. With "fts" defined as your default imtype, you can give just the root name without the extension, and IRAF will be default assume the extension ".fts".
name exp target dark01.imh 10 dark dark02.imh 10 dark dark03.imh 10 dark dark04.imh 30 dark dark05.imh 30 dark dark06.imh 30 dark dark07.imh 300 dark dark08.imh 300 dark dark09.imh 300 dark flat01.imh 20 V flat, evening flat02.imh 40 " " " flat03.imh 90 R flat, evening flat04.imh 120 " " " flat05.imh 180 R flat, morning flat06.imh 150 " " " flat07.imh 60 V flat, morning flat08.imh 30 " " " n1001.imh 30 standard star, R n1002.imh 30 standard star, R n1003.imh 30 standard star, V n1004.imh 30 standard star, V n1005.imh 300 M67, R n1006.imh 300 M67, R n1007.imh 300 M67, V n1008.imh 300 M67, V n1009.imh 10 standard star, R n1010.imh 10 standard star, R n1011.imh 10 standard star, V n1012.imh 10 standard star, V zero01.imh 0 zero zero02.imh 0 zero zero03.imh 0 zero zero04.imh 0 zero zero05.imh 0 zeroUse a text editor to write index files of your frames, sorted by type, exposure time, and filter. Each file (plain text) will contain nothing but a list of file names. For these data, you would need to make the following index files:
darkframes.all flatframes.all objframes.all zeroframes.all darkframes.10s objframes.10s darkframes.30s objframes.30s darkframes.300s objframes.300sIt's also useful, though not absolutely essential, to make index files of the flats and object frames sorted by filter:
flatframes.V objframes.V flatframes.R objframes.RThe "objframes" files should list the exposures of all real astronomical targets, standard stars included. Other than that, the names ought to be self-explanatory. For instance, the index file "darkframes.30s" for our fictional night would look like this:
dark04.imh dark05.imh dark06.imhAnd "objframes.V" would contain
n1003.imh n1004.imh n1007.imh n1008.imh n1011.imh n1012.imhObviously, if you have observed in more than 2 filters, you will need more index files.
Proofread your index files carefully, since they must be error-free!
cc> hedit @objframes.all imagetyp object add+ verify- cc> hedit @flatframes.all imagetyp flat add+ verify- cc> hedit @darkframes.all imagetyp dark add+ verify- cc> hedit @zeroframes.all imagetyp zero add+ verify-   Your image headers have an EXPTIME keyword that gives the total exposure time, but they do not have the DARKTIME keyword, which gives the total time that the detector was accumulating charge. We are assuming these are the same for our camera; however, we still need to add the DARKTIME keyword and give it the correct value. Here is a single command which will make the change to all images in one pass:
cc> hedit *.imh darktime "(exptime)" add+ ver-   You also need to add the CCD gain and readnoise to the headers. The most recently measured values can be found in the GOT Observer's Guide. The needed header keywords can be added like this:
cc> hedit *.imh gain ### add+ verify- cc> hedit *.imh rdnoise ### add+ verify-where ### should be replaced with the correct numerical values.
   Finally, IRAF recongizes the header keyword FILTERS, but the CCDOPS software calls this FILTER. This command will add the FILTERS keyword to all the flat-field and object headers and give it the same value as FILTER:
cc> hedit @flatframes.all,@objframes.all filters "(filter)" add+ ver-Notice that there is no space after the comma!
cc> setinstrument directThis pops you into the parameter editor for the CCDRED package (p. 10). Check to be sure that the pixeltype is "real real", then exit the parameter editor with CTRL-D (not CTRL-Z, as the Guide says!). This takes you to the parameter editor for the 'ccdproc' task. The trimsec and biassec should both be set to "image", but it really doesn't matter if they're not. Exit this editor with CTRL-D also. You should now be able to use 'ccdlist' to verify that things are set correctly, e.g.,
cc> ccdlist flat04.imh flat04.imh[1530,1020][ushort][flat][R]The pixel type will remain "ushort" until you actually begin the processing. Note that the image type is now correctly given as "flat" and the filter is shown too. You can check that all the image types were assigned as you wanted by using your index files, e.g.,
cc> ccdlist @objframes.allshould give you a list of images all with image type "object". But remember that the image types will be correct only if your index files are correct! You can check the filters in a similar way, e.g.,
cc> ccdlist @flatframes.IYou can doublecheck that you have the exposure times indexed correctly by doing, for example,
cc> imhead @darkframes.300s l+ | match EXPTIME EXPTIME = 3.0000000000E+02 / EXPOSURE IN SECONDS EXPTIME = 3.0000000000E+02 / EXPOSURE IN SECONDS EXPTIME = 3.0000000000E+02 / EXPOSURE IN SECONDS
But if any of the exposure times are off you will have to figure out for yourself which ones they are.
cc> imstat @zeroframes.all
# IMAGE NPIX MEAN STDDEV MIN MAX
zero01.imh 1560600 101.7 6.019 76. 189.
zero02.imh 1560600 99.69 6.002 73. 177.
zero03.imh 1560600 98.66 5.981 72. 271.
zero04.imh 1560600 98.7 6.01 72. 284.
zero05.imh 1560600 99.66 6.009 74. 356.
You want to verify that all of your zeros have roughly the same mean and
standard deviation. In this example they all look OK. If any of the frames
seems deviant, edit your index file and delete the name of the deviant image
so that it won't get used.
   Use the image display to visually examine all of the good zero frames. Zoom out and move around so that you can look at the whole image. You are looking for images that have significantly different shape from the others (something that 'imstat' might not have revealed). If you find any, delete them from the index file. It is not uncommon for the first zero of a set to be weird. You don't want to be deleting more than one or two of your zeros; if you are finding that you need to throw out a lot of them, there is some problem with your data. But remember that some variation in the images is natural. Don't put too much weight on the colors in the displayed image (if you are displaying with a color table), because IRAF is automatically scaling the colors based on the pixel values. When you 'display' an image, IRAF reports back the z1 value, below which all pixels are displayed as black, and the z2 value, above which they are all white. If you want to set the z1 and z2 manually, it's done like this:
cc> display zero06.imh 1 zsc- zra- z1=80. z2=200.
   If you have dark frames at 3 or more different exposure times, it is good to check the linearity of the dark current using the results from 'imstat'. Plot the mean of the dark image minus the mean of the zeros against the exposure time. The points ought to fall on a straight line through the origin. The slope of the line times the gain should be consistent with the dark rate given in the GOT Observer's Guide for your operating temperature.
   Run the task. Your output should resemble Figure 5. Then examine your combined Zero using 'imstat' and the image display. Its properties should be consistent with those of the frames that were combined.
   Then why, you ask, did we take the zeros in the first place? Because not all of our images are 10, 30, or 300 seconds long. In particular, the flats have non-standard exposure times. For these, we have to use the usual procedure implemented in 'ccdproc', which goes like this: First we compute a combined dark frame which is bias-subtracted using the combined Zero. This corrected dark count should scale linearly with the exposure time. Then the flat-field exposures are also zero-subtracted. Finally the dark count is scaled to the exposure time of each flat and subtracted. This procedure is slightly imperfect only because our zeros aren't really zeros; but for well-exposed flat fields the difference will be minuscule. (If you also have object frames that don't have darks of the same exposure time, treat them the same way we treat the flats in this example.)
   So first you need to make a combined dark frame for each of your dark exposure times. In our example we have 10, 30, and 300 s darks, so we'll run 'darkcombine' 3 times. The parameters are shown in Figure 9. For the first run we'll make the input "@darkframes.10s" and the output "Dark10s". All the other parameters are as they are in Figure 9, EXCEPT that "process" must be set to "no". This is crucial. Run the task, then reset the input name to your next dark index file and the output name to something appropriate. For our example data we make 3 images, Dark10s.imh, Dark30s.imh, and Dark300s.imh.
   Inspect these combined darks, and make sure they look reasonable.
   Next, edit the parameters for 'ccdproc' (epar ccdproc). In the second group of parameters, that asks what corrections you want to apply, set everything to "no" except "zerocor" (zero level correction); set that to "yes". In the next section down, set "zero" (zero level calibration image) to the name of your combined zero. In our example this is Zero.imh. DO NOT run the task. Instead, exit the parameter editor with CTRL-D, saving the changes. (Don't exit with CTRL-C, because this won't save the changes.) Now go back and edit the parameters for 'darkcombine'. Set the input to "@darkframes.all", the output to "DarkZ" (for Zero-corrected), and set "process" to "yes". Exit with :go, running the task.
   Inspect the zero-corrected combined dark for major problems. It's also interesting, by the way, to see what 'ccdlist' now says:
cc> ccdlist dark*.imh,Dark*.imh dark01.imh[1530,1020][real][dark][][Z]: dark02.imh[1530,1020][real][dark][][Z]: dark03.imh[1530,1020][real][dark][][Z]: dark04.imh[1530,1020][real][dark][][Z]: dark05.imh[1530,1020][real][dark][][Z]: dark06.imh[1530,1020][real][dark][][Z]: dark07.imh[1530,1020][real][dark][][Z]: dark08.imh[1530,1020][real][dark][][Z]: dark09.imh[1530,1020][real][dark][][Z]: Dark10s.imh[1530,1020][real][dark][]: Dark30s.imh[1530,1020][real][dark][]: Dark300s.imh[1530,1020][real][dark][]: DarkZ.imh[1530,1020][real][dark][][Z]:Notice the Z that has appeared in the last bracket, indicating those images that have been Zero corrected!
   If you have object frames of non-standard exposure times, repeat the above, using their index files for the input image list and leaving everything else the same.
   Repeat, changing the input image list and dark calibration image name, for your other exposure times. 'ccdlist' should now indicate that the flats have been zero and dark [ZD] corrected, while the object frames are only [D]. Any object frames of non-standard exposure times should have been processed like the flats, so they should appear as [ZD].
   If you examine your images now, you should find that the "snow" has disappeared, and you can actually start to see your faint targets!
   You may need to throw out overexposed images (pixel values approaching 60,000), underexposed images (pixel values under a few thousand), or images taken before the CCD was uniformly cool (look for funny stuff in the corners that diminishes in progressively later exposures). Stars in the twilight flats are not by themselves a problem, since they are usually rejected by 'flatcombine', but you will want to avoid exposures that have stars in the same place. If you need to throw out some frames, delete their names from the index files. But be judicious; obviously, you don't want to throw out so much data that you have nothing left.
   Edit the parameters for flatcombine. They should look like the list in Figure 10, except for the following: the input list should be "@flatframes.all", "process" should be set to "no", and "scale" should be set to "none". Run the task; the output will show you what frames are being combined for each filter. In our example we have data in V and R, so we will get two combined flats, FlatV.imh and FlatR.imh.
   Inspect the combined flats. They should still show the same basic shape, and many of the doughnut-shaped dust shadows will still be there. But there should not be any bright spots or things that look like stars or parts of stars. If there are, it probably means that you have combined images that have stars or cosmic rays in the same place, and you may need to edit your input list and run 'flatcombine' again to avoid this happening. Don't settle for "good enough" on your flats. Every imperfection in the flat will be permanently etched into your final data.
   Finally, have a look at your data. If all the steps have been successful, you should see nice clean images of your objects, with beautiful flat skies and no "garbage". If that's what you have, give yourself a pat on the back and celebrate--- but not too much, because now you have to start on the science!