IRAF paso a paso: 1 - Basic notions


A quick ID of IRAF

What does IRAF stand for? Image Reduction and Analysis Facility.
Who wrote it? People at the National Optical Astronomy Observatories (NOAO).
Why did it become so popular? It was selected, among other available softwares, by STScI as the one on which to layer all the software to reduce data from the Hubble Space Telescope (STSDAS).
Other reduction packages based on IRAF? STSDAS (Space Telescope Science Data Analysis System)
TABLES
and many other external packages (gemini, rvsao, xdimsum, etc.).
Who supports it? The NOAO staff (for IRAF), the STSDAS/TABLES group at STScI, myself (IAC), etc....
What's IRAF's programming language? It is called SPP = Subset Preprocessor Language, sort of a mix between FORTRAN and C. Also, IRAF tasks themselves can be used as subroutines to write CL scripts.

The current version of IRAF, as of July 2006, is v2.12.2a.


Getting started happily

What you should have:
  1. The proper definitions at UNIX level (let's assume you do).
  2. A directory from which to start IRAF; always use this directory, never start from another one! Usually it is: "/home/username/iraf/".
  3. A file called login.cl, and a file called loginuser.cl. Usually, the first file contains general definitions and settings, while the second file is the appropriate place where to put personal settings and options, as it is not overwritten by mkiraf.

Note: the login.cl file is created by mkiraf; loginuser.cl is not, but can be copied from another user, or just use this loginuser.cl template and modify it according to your needs.
IRAF is then started typing ecl or ncl (see next chapter). Use a XGterm terminal (just type xgterm from any terminal), which provides the most suitable graphical display and interface. Some graphical tools, and line command editing as well, may not work or produce unwanted side-effects in a xterm or other terminal type.


Do I need anything else?

IRAF requires an external image display program. You may choose between the following two

XImtool: Useful for comparing different images, or blinking; very easy for printing images. It's developed and maintained by the IRAF Group. Unfortunately it only works in 8-bit depth. (A new 24-bit capable version is available, though it needs to be polished a little bit).
DS9: Deep Space 9? Successor of SAOTNG. DS9 most important feature is that it can work in 24-bit depth displays. It is also available for Windows.

Currently we only support DS9, as it is the only one to work in 24- bit depth.
To start the DS9, just type ds9 in any terminal.

Warnings:

Question: do I need a graphic window too? No, it automatically pops-up as soon as you do some graphic stuff.


Know and customize your IRAF environment

Important if you want a pleasant trouble-free session.
cl> show | page
will show an almost endless list of variables.
Most are related to the directory tree of IRAF, and are relatively uninteresting. However you should become at least familiar with the variables that are listed in the table below.


Important/useful variables: (| means or)
Variable Examples Definition
terminal xgtermc | xtermjhs tells IRAF what type of terminal it's using
printer lw4 | lw11 tells IRAF what printer to use
stdplot lw4 | eps | eps tells IRAF where to send plots for hardcopies
stdimage imt800 | imt5 sets the size of the image buffer (NOT the physical size of the display window)
stdgraph xgtermc | stdplot tells IRAF where to display graphics
imtype imh | hhh | fits sets the default image format
min_lenuserarea 24000 | 120000 sets the size of space available for the image header
imdir HDR$ | HDR$pixels defines the directory in which files .pix are stored
uparm home$uparm/ defines the directory in which customized parameter files are stored
tmp /usr/tmp/ defines the directory where to store temporary files
glbcolor pt=4,fr=9,al=4,tl=4,ax=4,tk=4,gr=4 defines the colors for the elements of the graphic plot (more on XGterm colors)
clobber yes | no determines whether files will be overwritten or not
imclobber yes | no determines whether images will be overwritten or not
node cherne! tells IRAF where the image display is (trailing "!" is required). Rarely used.

How to set a variable to new value:

Command Example Description
set variable=value set stdimage=imt1600 change value temporarily: if you exit the current package (typing bye), variable is set back to previous value.
reset variable=value reset stdimage=imt1600 change value; will be kept during the whole session.

You can put variable settings and definitions in your loginuser.cl file to load them automatically when you start IRAF.


Two comments:

Sometimes, when you set a variable to a new value, IRAF still uses the value it has in memory and does not pick up the change. A couple of cl> flpr usually solve the problem.


A quick look at the IRAF structure

The basic element of IRAF is the task: command or program used to perform a specific function.
Tasks doing similar and/or logically related functions are grouped together into a package.
Also, packages can themselves be grouped into higher-level packages, to give IRAF an organized and logical structure.
 
An example of the hierarchical structure:

main package sub packages sub-sub packages tasks
noao imred ccdred badpiximage
ccdgroups
ccdhedit
ccdinstrument
.....
.....
argus
bias
ctioslit
dtoi
echelle
generic
hydra
iids
irred
irs
kpnocoude
kpnoslit
specred
vtel
artdata
astrometry
astutil
digiphot
focas
mtlocal
nobsolete
nproto
observatory
onedspec
rv
surfphot
twodspec


Another example: the structure of STSDAS (several versions ago; more recent versions may show many changes with respect to this figure).

stsdas

Note that a task may belong to different packages; sometimes it has different default settings depending on the package it is called from.