1 INTRODUCTION

This document describes the IMG library and how to use it to access astronomical images and header information from within your programs. The library has been designed to be easy to use and understand and will be of most interest to astronomers who write their own software and require uncomplicated access to their data. In this context, an “image” may be an ordinary (2-D) image, but could also be a spectrum (1-D) or “data cube” (3-D).

The data format used by the IMG library will normally be the Starlink “Extensible N-Dimensional Data Format” or NDF (described in SUN/33), which is typically stored in files with a .sdf extension. However, IMG can also access other astronomical formats (such as IRAF, disk FITS or FIGARO) and new ones can easily be added, so using IMG gives your programs access to a wide range of astronomical data in a very straightforward way (see §5.2).

IMG can be used from the Fortran-77 and C programming languages and some familiarity with one of these is assumed, as is knowledge of the UNIX C-shell. If you want to use IMG from C then you should briefly study the earlier sections (which are Fortran specific, but nevertheless show the appropriate calling sequences and discuss more general issues) and then look at appendix C.