In IRAF jargon, an application is called a
task and logically related tasks are grouped together in a
package. Before you can use a task, you must load the package containing that task. To load a package, type the name of the package. The prompt will then change to the first two letters of the package name, and the screen will display the names of all the newly available tasks and subpackages. Even though the prompt has changed, previously loaded packages remain loaded, and all their tasks remain available.
The standard way to specify a path through the IRAF package hierarchy to a task in a particular subpackage is to separate the package names with periods (e.g.,
stsdas.hst_calib.foc.focgeom.newgeom).
The most frequently used packages can be added to your login.cl file. List the packages, one per line in that file, and each will be loaded automatically when
IRAF is started.
|
•
|
? - Lists tasks in the most recently-loaded package
|
|
•
|
?? - Lists all tasks loaded
|
|
•
|
package - Lists all packages loaded
|
|
•
|
bye - Exits the current package
|
The simplest way to run a task is to type its name or any unambiguous abbreviation of it. The task will then prompt you for the values of any required
parameters. Alternatively, you can specify the values of the required
parameters on the command line when you run the task. For example, if you want to print header information on
myfile.hhh, type:
To run an operating system-level command (i.e., Unix command) from within the IRAF CL, precede the command with an exclamation point (!). This procedure is called
escaping the command. For example:
You can run tasks in sequence if you desire, with the output of one task being used as the input for another. This procedure, called
piping, is done by separating commands with a vertical bar (
|), using the following syntax:
st> task1 filename | task2
|
st> task1 filename | page
|
You can also redirect output from any task or command to a file by using the greater-than symbol (
>) as follows:
|
•
|
IRAF tutorials and CL tips
|
You can get online help with any IRAF task or package by using the
help command,
1 which takes as an argument the task or package name about which you want help. Wildcards are supported. To display the online help for the
STSDAS mkmultispec task, type:
Two STSDAS tasks that display particular sections of the help file are also available:
|
•
|
examples - Displays only the examples for a task.
|
|
•
|
describe - Displays only the description of the task.
|
Typing help package will produce one-line descriptions of each task in the package.
|
•
|
Use help package to search through the IRAF/ STSDAS package structure.
|
|
•
|
Use the apropos task as shown in Figure 4.4 to search the online help database. This task looks through a list of IRAF and STSDAS package menus to find tasks that match a specified keyword. Note that the name of the package containing the task is shown in parentheses.
|
IRAF Tutorials and CL tips
Parameters specify the input information for
IRAF tasks. They can be the names of input or output files, particular pixel numbers, keyword settings, or many other types of information that control the behavior of the task.
|
•
|
lparam to display the current parameter settings (abbreviated lpar)
|
|
•
|
eparam to edit parameters (abbreviated epar)
|
The lpar command lists the current parameter settings for a given task (see
Figure 4.5).
Epar is an interactive parameter editor. It displays all of the parameters and their current settings. You can move around the screen using the arrow keys and type new settings for any parameters you wish to change.
Figure 4.6 shows what you will see when typing
epar strfits when using the CL interface.
Parameters are either required or
hidden, and each parameter expects information of a certain
type. Usually, the first parameter is required, and very often it expects a file name. Parameters are described in the online help for each task. Hidden parameters, shown in parentheses in the online help and the
lpar and
epar listings, need not be specified at each execution because their default values frequently suffice.
If you specify the wrong type of information for a parameter, epar will usually display an error message saying something like “Parameter Value is Out of Range.” The message is displayed when you move to another parameter or if you press

.
Table 4.1 lists the different parameter types.
Occasionally, IRAF might get confused by your parameter values. You can restore the default parameters with the
unlearn command. You can use
unlearn either on a task or an entire package. Help on using
unlearn can be found online:
|
|
The unlearn command generally will restore the parameters to reasonable values, a big help if you are no longer sure which parameter values you have changed in a complicated task.
|
IRAF uses
environment variables to define which devices are used for certain operations. For example, your terminal type, default printer, and the disk and directory used for storing images are all defined with environment variables. Environment variables are defined using the
set command and are displayed using the
show command.
Table 4.2 lists some of the environment variables that you might want to customize.
You can set your environment variables automatically each time you login to IRAF by adding the appropriate commands to your
login.cl file. Use your favorite text editor to specify each variable on its own line. The
show command with no arguments prints the names and current values of all environment variables.
IRAF recognizes a number of different file structures. Among them are the standard
HST file formats known as GEIS and FITS (see
Chapter 2), both of which differ from the original
IRAF format, OIF.
|
•
|
A header file, which consists of descriptive information. IRAF (OIF) header files are identified by the suffix . imh. GEIS header files are in ASCII text format and are identified by the suffix . hhh or another suffix ending in “ h”, such as . c0h or . q1h.
|
|
•
|
A binary data file, 2 consisting of pixel information. IRAF data file names end with a . pix suffix. STSDAS data files end with a suffix of . hhd or another suffix that ends with “d”, such as . c0d or . q1d.
|
STSDAS always expects both component files of a GEIS image to be kept together in the same directory.
Most tasks in IRAF and
STSDAS operate on files and expect you to specify a file name for one or more parameters. Special syntax can be used with certain tasks when specifying file names. These syntax features include:
|
•
|
Wild card characters, often called templates, which are used to specify multiple files using pattern matching techniques. The wild cards are:
|
|
-
|
* Matches any number of characters, e.g., j91k10pt*.fits
|
|
-
|
? Matches any single character, e.g., z01x23x.c?h
|
|
•
|
List files, often called @-files, are ASCII files that contain lists of file names, one per line. If your task supports the list file feature, you would type the name of your list file, preceded by the “@” character. For example: @infiles.txt
|
|
•
|
Image section specification. Tasks that work with image data will allow you to specify a part of the image rather than the entire image. To extract a particular image section, specify each axis range in square brackets, for example: image.hhh[10:200,20:200]
|
|
•
|
IRAF networking specification. IRAF is capable of reading and writing files to and from remote systems on a network. This feature is often used with tasks in the fitsio and convfile packages, or with image display tasks. The STSDAS User’s Guide and the online help (type help networking) describe how to enable this feature. To specify that you want to use the IRAF networking feature, type the remote host name followed by an exclamation point (!), followed by the file or device name. For example: nemesis!mta
|
For example, when displaying from an IRAF session running on a remote machine back to your work station set the environment variable “node” by typing:
set node= my_workstation!
|
•
|
path or pwd - Lists the current working directory.
|
|
•
|
cd directory - Move to the named directory.
|
|
•
|
back - Revert to directory last visited.
|
|
•
|
When you run an IRAF task for the first time in a session, IRAF stores the executable file in its process cache. If IRAF appears not to be running your tasks properly, you may need to use the flprcache command to clear the process cache. To do this, type flpr. Sometimes you will need to execute this command a few times.
|