next up previous FTOOLS Home
Next: Task Development Up: Developer's Guide Previous: Package Directory Structure

Task Design

FTOOLS tasks allow the user to create, examine or modify FITS data files. The core of each task is a FORTRAN 77 subroutine. This subroutine uses library calls to interface with the parameter files containing program control options and the FITS files containing the data. There are two distinct libraries in place for interfacing with the parameter file:

  • IRAF spp library developed by the STSCI
  • XPI library developed by HEASARC

The XPI library allows developing tasks in the Host Unix or VMS environment. The IRAF spp library is for task development under IRAF only.

The interface to FITS data files is accomplished with the FITSIO library developed by Bill Pence. This library contains low level I/O routines which differ from one machine architecture to another. In addition, an IRAF spp version also exists. Currently, the spp library is linked in with the IRAF version of the FITSIO library.

Each task has an associated parameter file. This file follows the IRAF parameter file standard. It provides a mechanism for controlling the operation of a task. Among the features supported by the parameter files are (min, max) range checking, default values, parameter hiding, and friendly user prompts for input/output parameters. Detailed discussion of the format of a parameter file can be found in IRAF documents.

The FORTRAN 77 subroutine is written in strict compliance with ANSI standard to maximize portability. The source code contains plenty of comments and is an excellent starting place for anyone wishing to write their own FTOOLS task. Being that these are subroutines, a main program must be written to control the task and call the subroutine. In the IRAF version of FTOOLS there are two main programs, one for each sub-package, x_asca.x, x_caltools.x, x_einstein.x, x_fimage.x, x_futils.x, x_gro.x, x_heasarc.x, x_rosat.x, x_time.x, x_vela5b.x, x_xronos.x and x_xte.x found in the sub-packages' src subdirectories. In the Host version a C main routine exists for each task and is used to read the command line and pass values on to the XPI library and the FORTRAN subroutine.

It is also possible to write an FTOOLS task entirely in C. For a good example of this, look at the task trans2fits in the xte sub-package. The examples directory also contains a C tools for your examination: cdummyftool.


next up previous FTOOLS Home
Next: Task Development Up: Developer's Guide Previous: Package Directory Structure

Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov

FTOOLS HELP DESK

If FTOOLS has been useful in your research, please reference this site (http://heasarc.gsfc.nasa.gov/ftools) and use the ASCL reference for HEASoft [ascl:1408.004] or the ASCL reference for the original FTOOLs paper [ascl:9912.002]:

Blackburn, J. K. 1995, in ASP Conf. Ser., Vol. 77, Astronomical Data Analysis Software and Systems IV, ed. R. A. Shaw, H. E. Payne, and J. J. E. Hayes (San Francisco: ASP), 367.

Web page maintained by: Bryan K. Irby