next up previous
Next: SETTITLE Assign a New NDF Title
Up: EXAMPLE APPLICATIONS
Previous: EXAMPLE APPLICATIONS

SHOW -- Display the size of an NDF  

This first example is trivial and simply serves to show the overall structure of an ADAM application which calls the NDF_ library. It outputs a message showing how many pixels there are in an NDF.

      SUBROUTINE SHOW( STATUS )
*+
*  Name:
*     SHOW

*  Purpose:
*     Show the size of an NDF.

*  Description:
*     This routine outputs a message showing how many pixels there are
*     in an NDF.

*  ADAM Parameters:
*     NDF = NDF (Read)
*        The NDF whose size is to be displayed.

*-
      
*  Type Definitions:
      IMPLICIT NONE              ! No implicit typing

*  Global Constants:
      INCLUDE 'SAE_PAR'          ! Standard SAE constants

*  Status:
      INTEGER STATUS             ! Global status

*  Local Variables:
      INTEGER INDF               ! NDF identifier
      INTEGER NPIX               ! Number of NDF pixels

*.

*  Check inherited global status.
      IF ( STATUS .NE. SAI__OK ) RETURN

*  Obtain the input NDF and enquire its size.
      CALL NDF_ASSOC( 'NDF', 'READ', INDF, STATUS )
      CALL NDF_SIZE( INDF, NPIX, STATUS )

*  Display the size.
      CALL MSG_SETI( 'NPIX', NPIX )
      CALL MSG_OUT( 'SHOW_SIZE', 'This NDF has ^NPIX pixels.', STATUS )

*  Annul the NDF identifier.
      CALL NDF_ANNUL( INDF, STATUS )

      END

The following is an example ADAM interface file (show.ifl) for the application above.

interface SHOW

   parameter NDF                 # NDF to be inspected
      position 1
      prompt   'NDF data structure'
   endparameter

endinterface



next up previous
Next: SETTITLE Assign a New NDF Title
Up: EXAMPLE APPLICATIONS
Previous: EXAMPLE APPLICATIONS


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

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