Subsections
The Image Reduction and Analysis Facility (IRAF) is a suite of
software developed by NOAO in the 1980's. It provides an environment
for the reduction and analysis of astronomical data that is widely
used, especially in the US astronomical community. However, there are
certainly a number of astronomers who find the IRAF approach
somewhat cumbersome or opaque, and who prefer to develop their
own tools for data reduction. Nonetheless, some familiarity at least
with IRAF tools is probably a very good idea.
IRAF has been incorporated into a more modern interface with the
development of PYRAF, which is a Python front-end to the IRAF routines.
In this day and age, use of IRAF through this interface, as opposed to
the traditional CL interface, is strongly recommended!
IRAF/DS9
basic operation
- One time only for each directory you will run in: run mkiraf, which creates
login.cl, and starts a uparm/ subdirectory for parameter files. The login.cl
can be customized at a later time if you have settings you
want to start with every time.
- to enable a larger frame buffer for display, uncomment
and modify line: stdimage = imt2048
- The preferred method of running IRAF in the modern era is
using the PYTHON interface, pyraf
- If you will be displaying images, start an image display
tool, i.e. DS9, in the background: ds9 &. Be aware
that the stdimage that is set in the login.cl file may
limit the maximum size of the image that will be displayed!
- help:
- basics:
- IRAF contains many programs for astronomical
analysis. These are grouped into packages,
and individual commands are tasks within each
package. Before a particular task can be run, the
package within which it is located must be loaded,
which is done by entering the package name. Several
packages are loaded by default, and this can be customized in
the login.cl file. If you know a task name, and need to find
out what package it can be found in, try the iraf.apropos('task') command (apropos task in IRAF interpreter)
- e.g., to load noao package via Python interpreter: iraf.noao();
to load noao package via PYRAF interpreter: noao
- common packages: iraf.imred(), iraf.onedspec(), iraf.twodspec()
- to list tasks in package: iraf.help('package')
- Most tasks have a set of adjustable
values, or parameters, which govern the specifics of how the
task operates. IRAF manages the values of these parameters
by having an individual parameter file for each
task. You can look at and modify the parameter values for a
given task using the iraf.epar('taskname')(in CL: epar taskname) command, or iraf.lpar('taskname') to just print a list. This is
useful for seeing what all of possible parameters are. If you
modify parameters using epar, the modifications are
saved and will be used in all future invocations of the task!
- parameters are saved in files in a uparm/ directory
- because of this behavior, it is useful, and
perhaps even wise, to know how to reset parameters back
to their default values: this can be accomplished using
the iraf.unlearn('taskname') (unlearn taskname) command
- You can get detailed information about each task and
its parameters using the iraf.help('taskname') (help tasknamera) command.
This is also available through the graphical epar.
- You can override a value from the parameter file by
specifying it as a keyword in the commande, e.g. valname=xxxx. In this
case, the parameter file is not permanently modified. This
is convenient for scripting. On the command line, keywords
are separated from the command and each other by spaces.
- In the Python interface, parameters can also be accessed/modified
as attributes of the task
- IRAF is a disk-based system: commands that work
with images require filenames of input images and filenames
for output images.
- You can issue operating system commands from within IRAF
command language by starting the command lines with an !
- image display with DS9 through IRAF: the display task
- image cross sections: the implot task.
- See plot window commands ('?')
- Image histogram: imhist. Look at the parameter file.
Note that you can specify image
subsections using filename[x1:x2,y1:y2]
- Image statistics: imstat. Look at the parameter file.
Note you can specify image subsections as above.
- Image arithmetic: imarith. You can do arithmetic with images
and constants, or with multiple images. For example:
imarith file1.fits - 363 will subtract a constant
of 363 from the image, imarith file1.fits / file2.fits
will divide file1 by file2 (on a pixel-by-pixel basis).
- Inspection of stellar images: imexam. Note 'a', 'r', and 'm'
keys, '?' for help (note you have to exit help to get interactive
cursor!), 'q' for quit
- For many tasks that require an input file, it is possible to
specify a list of input files if the same action is to be taken
on each. This is accomplished by creating a file (e.g., files.lis) that
has a list of all of the files that you wish to run the task on, each
on a separate line. Then, instead of giving an image name to the task,
you give the list file name than contains the image names, preceded by
an @ sign, e.g. @files.lis. Remember when you are proccessing images
that IRAF wants to write the output files; if you don't have write permission
in the input directory, you'll need to also supply an @output.lis file
with the names for the output images.
- Quit pyraf using the .exit command
IRAF package imred/ccdred: zerocombine, darkcombine, flatcombine, ccdproc
(note need for header cards)
lower level: imcombine, image arithmetic
Note that you may have to do a iraf.setinst first, have to pay attention
to ccdproc parameters!
IRAF file list specification: comma-separated string
phot/apphot
- Display some images, get comfortable with setting display parameters
- Do some of the usual: image histograms, cross section plots, regions
statistics, PSF measurements. Use all of the routines mentioned above.
- Reduce a nights worth of data. Script it.
- Quantitatively assess the quality of the flat fields by
looking at the flatness of the sky background in the reduced frames.