next up previous 231
Next: COMPILING AND RUNNING PROGRAMS
Up: USING THE NDF LIBRARY TO DO MORE
Previous: Accessing foreign data formats

Using the NDF library directly

When all else fails, the full power of the NDF library (SUN/33) can be made available using the call:
      CALL IMG_INDF( 'IN', ID, ISTAT )
This returns an NDF identifier (ID) to your image dataset (this shouldn't be confused with the pointers to images which we have used so far). This allows you to get at the other components of the NDF (our ``images'' are really the main NDF data array) such as its variance, quality or world coordinate system. It also allows you to access NDF extensions (our ``sources'' of header information) in more sophisticated ways. As a very simple example the next program snippet shows how to write out the name of an image dataset (also see IMG_NAME):
      CALL IMG_INDF( 'IN', ID, ISTAT )                        [1]
      CALL NDF_MSG( 'NAME', ID )                              [2]
      CALL MSG_OUT( ' ', 'Name of image = ^NAME', ISTAT )     [3]
      CALL NDF_ANNUL( ID, ISTAT )                             [4]
The following notes refer to the numbered statements:
1.
IMG_INDF returns an NDF identifier ID.

2.
The NDF subroutine NDF_MSG sets a message token 'NAME' (see SUN/104).

3.
The name is written out.

4.
The NDF identifier is annulled. It is important that you remember to do this once the identifier has been finished with.



next up previous 231
Next: COMPILING AND RUNNING PROGRAMS
Up: USING THE NDF LIBRARY TO DO MORE
Previous: Accessing foreign data formats

IMG Simple Image Data Access
Starlink User Note 160
P.W. Draper
R.F. Warren-Smith
3 March 2003
E-mail:P.W.Draper@durham.ac.uk

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