1 General Introduction

The main goal of this guide is to describe how to write scripts that take full advantage of the features PyRAF provides. The presumption is that the scripts will be written in Python, but the use of IRAF CL scripts in PyRAF will be described as well. We will often show how an operation can be done in both Python and in the IRAF CL, primarily to help those who are familiar with the IRAF CL to find the corresponding operation in Python.

A Python script can call IRAF tasks, and a Python script can be defined as an IRAF-like task in PyRAF. These are not mutually exclusive options, but they are two distinct features of PyRAF. The first will be described in the section ``Writing Python Scripts that Use IRAF/PyRAF Tasks,'' while the latter will be described in the section ``Python Tasks.'' Other sections will explain how to define tasks in PyRAF based on IRAF executables, CL scripts, or host operating system commands (``foreign'' tasks).

While this document is an introduction to programming with PyRAF, it will be assumed that the reader is familiar with Python and with the calling conventions for Python functions, classes and methods. Python functions and IRAF CL scripts have some features in common, such as positional as well as keyword arguments, and a variable argument list.

Questions or comments? Contact help@stsci.edu
Documented updated on