Getting Started -- Changing the Default File Type
Once you have taken all of your images and have transferred them to your computer, you
will have to reduce them in order to get rid of background noise due to bias, dark, and
flats. But first, you will need to set IRAF to handle fits files as default. Otherwise
you will have to use the rfits command (See
UNM Tutorial).
In order to change the default, type in these steps:
show imtype | IRAF will print the type of image that is set as the default. It will probably print "imh" the first time you try this. |
set imtype="fits,noinherit" | This will set the default image type to fits files. When you process images, IRAF will automatically spit out a fits file. |
display filename frame | The file you have chosen will be displayed in the DS9 window. The frame parameter is a number which indicates which frame you want the image to pop up in. This way, you can have multiple images open. (See the DS9 Guide for more information.) If you don't enter a number, IRAF will prompt you for one. If you're not concerned about having more than one image open at a time, just choose "1" each time. |
Combining Bias Images
In order to combine your bias images, you will have to use the task zerocombine.
The first thing you should do is move into the appropriate directory. When you
open IRAF, you are located in your iraf directory. Inside the IRAF command window, you
can use Unix commands to navigate to other folders. Use the cd command to move to
different folders until you find the location of your bias frames. If you ever have to
refer to a certain image that is not in the current directory, you will have to specify
the path. (../ is often useful).
You now have to open the correct packages to run zerocombine. Enter imred,
and then ccdred and you will be set.
Now, set the following parameters by typing epar zerocombine:
input | You can set this in the parameters, or IRAF will automatically prompt you for a list of files to combine. (To create lists, see the UNM Tutorial) |
You can also choose a series of images (ex: bias1, bias2, bias3, etc) by typing in the characters your images start with, then star (ex: bias*). It is a good idea to think ahead when creating filenames so that you won't have to make lists. | |
output | IRAF will not prompt you to name the output file, so you will have to set it in the parameters. Luckily, IRAF will not write over files with the same name, so if you accidentally forget to change it, don't worry! |
A quick, easy way to fix this is to enter output=filename when you enter the command. That way, you will not always have to return to the parameter listing each time you run zerocombine. | |
combine="average" | |
reject="minmax" | |
ccdtype="none" | This is very important |
Zerocombine will look for images with IMAGETYP=zero in the fits header. However, images from Brackett Observatory do not contain an IMAGETYP header, so unless you set ccdtype to "none", zerocombine will not work on your images. Alternatively, you can create an IMAGETYP parameter for your bias images and set it to "zero". See Changing Fits Headers in the CCD Reduction with ccdproc section. | |
Ctrl+d | exits the edit parameters section |
Combining Dark Frames
For combining dark images, use the task darkcombine. This can be accessed by
entering imred and then ccdred from the cl prompt.
Check the parameter settings by entering epar darkcombing at the prompt:
combine="average" | |
reject="minmax" | |
ccdtype="dark" | IRAF will look for IMAGETYP=dark in the fits header or else it will not process the images. |
If you have changed the fits headers (See Changing Fits Headers), you can leave this parameter alone. If your fits headers are not labeled correctly, just change this parameter to "none". | |
process="no" | If processing is turned on, then the task ccdproc will be called on to subtract bias frames from your dark. |
If you are going to be using ccdproc later, this setting should definitely be turned off, or else the bias will be subtracted from your dark image a second time. | |
It is up to you whether or not you want the output dark to be bias subtracted or not. Keep in mind that ccdproc will subtract the bias from all of your dark frames and then save the subtracted image over the original. You will have to edit the parameter listing for ccdproc in order to select the bias frame. (See Ccdproc) | |
scale="none" | The default will be set to scale by exposure time. |
If you have images from Brackett Observatory, the fits headers will contain the exposure time. Images taken with V++ at Table Mountain will not. If you want your dark current to be scaled by exposure time, you will have to edit the fits header. (See Changing Fits Headers) | |
If you decide to scale the dark by exposure time, you will have to have the bias subtracted. (You can do this by turning the "process" option on.) Otherwise, the bias will end up being scaled, too. Once again, keep in mind that running ccdproc with the resultant darks will cause the bias to be subtracted again; you have to be very careful. |
Combining Flats
To combine flat images, use the task flatcombine. This can be
opened from the same package as zerocombine. From the cl prompt, just enter
imred and then ccdred. Once again, be sure that you are located in the
appropriate directory to access your files. If you are not, you will have to indicate a
path in order to get to them.
Next, edit the parameters by entering epar flatcombine:
input | You don't have to indicate a list of input files. IRAF will automatically prompt you. |
An easy way to bypass the prompt is to enter the names of the files you want to combine when you enter the command, like so: flatcombine filenames* | |
output | IRAF will not prompt you for an output filename when you enter the command. However, you can enter output=filename when you enter the command to prevent having to alter the parameter listing every time. |
ccdtype="none" | IRAF will look for images with IMAGETYP=flat in the fits header unless you change this option to "none". |
Alternatively, you can edit the fits headers and leave this setting to "flat". (See Changing Fits Headers) | |
combine="median" | The median option is good for combining flats, because it eliminates large counts from bright early evening/early morning stars. |
reject="none" | This controls the reject algorithm for processing the images. However, "none" is a good option because you can be sure that a median is being taken for every pixel. |
scale="mode" | For flats, scaling will help even out any effects of non-uniform light. Light from twilight or dawn is fairly even, but it is still a good precaution. You will definitely need to use the scaling option if you are using screen or dome flats. |
Ctrl+d | exits the edit parameters section |
Arithmetic Operations with imarith
The imarith task can be run from the cl prompt, and consequently
can be opened from any other package. Do not worry about adjusting the parameters for
imarith, because IRAF will prompt you for the appropriate parameters.
Enter imarith to receive the following prompts:
Operand image or numerical constant: | enter a list of images or a single image that you want to modify |
Operator (+|-|*|/|min|max): | pick which operation you want to perform. |
Operand image or numerical constant: | Enter the filename or path for the image you want to use to reduce the raw image. |
If you are working with bias, enter the bias filename; with flats, enter the flat filename. If you are creating a normalized flat, enter the mean value. | |
Resultant image: | Enter the filename you want the reduced image to be given |
If you are reducing multiple images at once, there is an easy way to add prefixes to each filename on the list. For example, if you want add the letter z to the beginning of each modified file, enter z//filenames. In general, whatever was entered in the first prompt should be entered behind the z// in this last prompt. |
Reducing CCD Images Using imarith
When you are ready to reduce your CCD images completely:
The task ccdproc can be accessed by opening the packages imred and then ccdred. You can use this command to process images without having to use multiple steps with imarith. First create your averaged bias and flat frames. Before you can run ccdproc, you will have to create and set an IMAGETYP parameter for your frames. Like zerocombine, ccdproc will only work with certain image types, but you can not turn this feature off.
Changing Fits Headers
There are four possibilities for the IMAGETYP header: zero, flat,
object, and comp. To create and change this header, you will use the task
ccdhedit, which can be accessed from the same packages as ccdproc. Be sure that you
are in the correct directory, or that you know the path to the images you want to modify.
Enter ccdhedit to receive the following prompts:
CCD images: | You can choose one or more images to edit. |
Image header parameter: | Enter IMAGETYP |
Parameter value: | Enter one of the four image types that you want for the selected images |
imhead filename | prints a short version of the fits header |
imhead filename l+ | prints the full fits header |
ccdlist filenames | prints short version of fits header for all of the selected images |
Using ccdproc
Make sure that you have opened the packages imred and ccdred
Enter epar ccdproc to set the following parameters:
images | Enter the images you want to correct. IRAF will prompt you for this parameter anyway. |
output | You will not be prompted for the output filename, and if nothing is entered IRAF will overwrite the original file. If you want to keep your backup, be sure to enter an output filename. |
If you are reducing multiple images at once, there is an easy way to add prefixes to each filename on the list. For example, if you want add the letter z to the beginning of each modified file, enter z//filenames. In general, whatever was entered in the first prompt should be entered behind the z// in this last prompt. | |
oversca="no" | The CCD chip from Brackett and Table Mountain do not have overscan sections, so make sure that this property of ccdproc is turned off |
zerocor="yes" | Turns bias correction feature on |
darkcor="no" | Images from Brackett are often Autodarked, so you don't need to worry about dark correction. If you are using images from Table Mountain, and you have measurable dark current, you might want to turn this feature on. |
flatcor="yes" | Turns flat correction feature on |
Be sure that the other correction types are set to "no" | |
zero | enter the path or filename for the averaged bias frame |
dark | enter the path or filename for the combined, non bias-subtracted, dark image |
flat | enter the path or filename for the combined (not normalized!!) flat frame |
Ctrl+d | exits the edit parameters section |
"ERROR:segmentation violation" is an all-purpose error. It is
possible that you have accidentally entered a filename that doesn't
exist. Check your path, directories, and spelling to be sure that you
have entered a valid filename.
Another cause for this error may be due to Unix's case-sensitive
nature. If the images you are trying to combine are titled *.FIT, you
will have to change them to *.fit. IRAF will not process them
otherwise.
If you are using lists, check what is inside. If there is an
object which is not an image file, there is your problem. (Be careful
when using * to select images for a list. You might accidentally
include something you did not intend to.)
If you get, "* is not an image or a number", you probably
have not entered a valid filename. Check to be sure you did not
mispell or point to an incorrect directory.
If you get a "no images to combine" error, it may be due to
the IMAGETYP parameter in the fits files. If you are trying to run
zerocombine or ccdproc, check that the IMAGETYP is set correctly or
set ccdtype equal to "none" in the parameters for zerocombine.
This error will also occur when you have not set the default image
type to "fits,noinherit". Go to the cl prompt and enter
show imtype to be sure that you have fits files set as default.
If you get, "Warning: Cannot open image", you have entered
an incorrect filename or path. Check for spelling and correct path.