Introduction to IRAF

by Andrew Walker



Setting up IRAF (Image Reduction and Analysis Facility)

In your home directory just type mkiraf and respond to the prompt with xterm. This will create a file login.cl and two sub-directories, uparm and images, for you.

Starting IRAF

To start up IRAF just type cl (for command language) in your home directory. You should make sure that you run IRAF from an xterm window, else the display may prove erratic.

The nature of IRAF

IRAF is hierarchical in nature with packages, tasks, and parameters. Packages contain tasks or further packages, and tasks contain parameters. As the name suggests it is the tasks that will perform some operation on an image or spectrum, the exact operation being determined by the way you set the parameters for that task.

To load a package or operate a task you simply type its name, and to obtain help on it simply type help [package/task]. When running a task you will be prompted for several parameters if you don't specify them in the command line.

You should be aware that IRAF stores the last values for all parameters that you used for a given task, and will use these as the default the next time the task is run. Each task may also have hidden parameters, which will not be prompted for each time the task is run, but can be set using epar [taskname], and then :g to run the task and save the parameters, or :q to just save the changed parameters but not run the task.

Pre-processing data in IRAF

At the most basic level, the pre-processing can be achieved by using the one task images.imarith, where images is a package name, and imarith the task name. This task allows you to add, subtract, divide, and multiply images together by setting various parameter values. e.g.
operand1 = image1
op = /
operand2 = image2
result = imageout
title =
divzero = 0.
hparams =
pixtype = real
calctype = real
verbose = no
noact = no
Only the first 4 parameters will be prompted for and the rest must be set using epar. It is important that you set both pixtype and calctype to real else the calculation will give integer results, which will be of little use to you.

To pre-process your data you must take at very least the following steps:

  1. bias subtraction: object - dark
  2. bias subtraction: lamp - dark
  3. flat-fielding: (object - dark) / (lamp-dark)
The output from this last step should give you a pre-processed image, which should account for the signature of the detector with which you took your observations.

Other Tasks

Other tasks which you may find useful when using IRAF to look at images are briefly summarised below: These are only a small fraction of all the available tasks within IRAF. Browse through the manual, or load up different packages, to get some idea of what else is available. The chances are that if you can think of something that it would be useful to have IRAF do, it already does it.

Image Display

The image display of choice is SAOimage. To start it up just type saoimage & from an xterm or command tool window. From within IRAF you will then need to type something like set stdimage=imt1024, where the numeric suffix will depend on the exact size of your image. To actually display an image you can use the images.tv.display task.