14

SUN/160.6

Starlink Project
Starlink User Note 160.6

P.W. Draper
R.F. Warren-Smith

3 March 2003

Copyright © 2000-2003 Council for the Central Laboratory of the Research Councils


IMG
Simple Image Data Access

Version 1.3

Subroutine Library



Abstract

IMG is a subroutine library for accessing astronomical image data and associated header information. It is designed to be easy to use and understand.

Contents

1 INTRODUCTION
2 ACCESSING IMAGE DATA
 2.1 Accessing an existing image
 2.2 Creating a new image
 2.3 Modifying images
  2.3.1 Modifying an image
  2.3.2 Modifying a copy of an image
3 ACCESSING HEADER INFORMATION
 3.1 Reading header items
 3.2 Writing header items
4 ADDITIONAL FEATURES
 4.1 More advanced image access
  4.1.1 Getting workspace
  4.1.2 Using “images” which are not 2-dimensional
  4.1.3 Accessing images using different data types
  4.1.4 Accessing multiple images
  4.1.5 Creating multiple images
  4.1.6 Handling “bad” data
 4.2 More advanced header access
  4.2.1 Accessing header items using different data types
  4.2.2 Using header items from different sources
  4.2.3 Accessing header items by index
  4.2.4 Special behaviour of FITS headers
  4.2.5 Hierarchical header items
5 USING THE NDF LIBRARY TO DO MORE
 5.1 Using regions and slices of images
 5.2 Accessing foreign data formats
 5.3 Using the NDF library directly
6 COMPILING AND RUNNING PROGRAMS
A ALPHABETICAL LIST OF FORTRAN SUBROUTINES
 A.1 IMG Fortran subroutines
 A.2 HDR Fortran subroutines
B FULL FORTRAN SUBROUTINE DESCRIPTIONS
 B.1 IMG Fortran subroutines
IMG_CANCL– Cancel an image/parameter association
IMG_DELET– Delete an image
IMG_FREE– Free an image
IMG_IN[n][x]– Access an existing image for reading
IMG_INDF– Return an image NDF identifier
IMG_MOD[n][x]– Access an image for modification
IMG_NAME – Return the image name
IMG_NEW[n][x]– Create a new image
IMG_OUT[x]– Create an output image
IMG_TMP[n][x]– Create a temporary image

 B.2 HDR Fortran subroutines
HDR_COPY – Copy header information from one image to another
HDR_DELET– Delete a header item
HDR_IN[x]– Read a header item
HDR_MOD– Open an image allowing modification of any header items
HDR_NAME– Return a header item name
HDR_NUMB– Return a header item count
HDR_OUT[x]– Write a header item

C USING IMG FROM C
 C.1 IMG C functions
 C.2 HDR C functions
 C.3 Examples of using IMG from C
  C.3.1 Accessing an existing image
  C.3.2 Creating a new image
  C.3.3 Modifying an image
  C.3.4 Modifying a copy of an image
  C.3.5 Getting images as workspace
  C.3.6 Using “images” which are not 2-dimensional
  C.3.7 Accessing images using different data types
  C.3.8 Accessing multiple images
  C.3.9 Handling “bad” data
 C.4 Examples of using HDR from C
  C.4.1 Reading header items
  C.4.2 Writing header items
  C.4.3 Accessing header items using different data types
  C.4.4 Accessing header items by index
  C.4.5 Reading and writing header items from/to many images
 C.5 Compiling and linking C programs
D Changes in release (1.1)
E Changes in release (1.2)
F Changes in release (1.3)
G Changes in this release (1.3-1)