A New CL for IRAF Based On Python

Perry Greenfield (STScI), Richard White (STScI)

Abstract:

The existing IRAF command language (the CL) has some significant shortcomings, particularly with regard to error handling and direct access to data. We have begun a project to develop a new CL to run IRAF tasks that will allow us to write more sophisticated and robust scripts, that enables command-line manipulation of data arrays, and that makes it possible to integrate outside software with IRAF.

Rather than start from scratch, we have decided to use an existing scripting language that is powerful, easy to use, and robust. While not the most widely used scripting language, Python is mature, heavily used, available on all popular computing platforms, and free (without even the restrictions of the Gnu Public License). The language is readable, object-oriented (though it can also be used for procedural programming), comes with extensive libraries, and offers a number of introspective and syntax-enhancing features. Furthermore, it is easy to extend or embed using C, and its Numeric extension provides IDL-like facilities for efficient manipulation of arrays.

We now have the ability to run IRAF executables from Python exactly as the IRAF CL does, as connected subprocesses. We follow the IRAF package structure and locate executables and parameter files in much the same way the IRAF CL does. We maintain a complete IRAF environment, with dictionaries of tasks, packages, parameters, and IRAF environment variables. We are able to run IRAF tasks that produce graphics by means of a new interactive graphics kernel, and we can also run interactive image display tasks. The new CL coexists with the old CL and requires no changes whatsoever to the existing IRAF system. We describe the methods used to implement these capabilities as well as our design choices in developing a new command language.



Web User
9/20/1999