Making a Task

Package Structure


Tasks in IRAF (and external packages such as STSDAS) are organized by package in the cl. The structure directories containing the source and run-time files reflects the package structure apparent from the cl. For example, in the case of STSDAS, each package resides in a directory under the stsdas root directory just as the STSDAS packages are organized under the stsdas package in the cl. There are several files common to the package as a whole and several similar files required for each task in the package. These files need to be modified when installing a new task. The required common files in the package directory are:

In the above file names, the name of the package is used in place of package. For example, the playpen package in STSDAS is in the directory stsdas$pkg/playpen and the procedure script is called playpen.cl. In addition, documentation files exist in the package level directory as well as a doc directory containing individual help files for the tasks in the package.

Tasks in the Package

Each task has additional files, the type of which depends on the nature of the task. These files would be added when you install a new task. Each task must also have entries in the package files. A cl procedure task requires only a task.cl file in the package directory, containing the cl statements and parameter definitions. For example, disconlab.cl in the playpen package. It also requires a task.hlp file in the doc subdirectory. An SPP (physical) task requires SPP source, at least one source file, by convention called t_task.x (with task replaced by the task name) playpen$t_wcslab.x, for example. Additional source files may reside in the package directory or in subdirectories. The task may use an include (header) file with the name task.h, playpen$wcslab.h, e.g. Each task requires a parameter file (unless it is a script, defined by a .cl file), task.
par, containing definitions of the task parameters, such as playpen$wcslab.par. The doc directory contains the task help files, one for each task in the package.

Implementation

The procedure, then, is to develop the application in a private directory with a structure similar to the intended target package. Development should be done in a local user directory rather than the system directories, not even the development system. Use an existing package as an example of how to proceed. When you are ready to install the package, copy the task files to the intended package directory and edit the existing package files to include references to the new package. Run mkpkg to rebuild the package with the changes (the added task). When you are satisfied that things work, run mkpkg install to move the executable to the appropriate binaries directory.

Tasks in the Package
Implementation

Generated with CERN WebMaker