next up previous
Next: The Storage Form of Axis Arrays
Up: AXIS COMPONENTS
Previous: Axis Normalisation Flags

The Numeric Type of Axis Arrays  

An NDF's axis array values may be stored using any of the seven non-complex numeric types described in §[*], and may also be accessed using any of these types. Type conversion will be performed automatically when required. By default, all axis arrays use a numeric type of `_REAL', although this may be changed if required (see below).

The routine NDF_ATYPE is provided for determining the numeric type of an axis array, as follows:

      INCLUDE 'NDF_PAR'
      CHARACTER * ( NDF__SZTYP ) TYPE

      ...

      CALL NDF_ATYPE( INDF, 'Centre', IAXIS, TYPE, STATUS )

This will return the numeric type as an upper-case character string (e.g. `_REAL') via the TYPE argument. Note the use of the symbolic constant NDF__SZTYP (as defined in the include file NDF_PAR) to define the length of the character variable which is to receive the returned value.

NDF_ATYPE will also accept a list of axis array names, and a value of zero may be given for the IAXIS argument to indicate that all the NDF's axes should be considered at once. In this case, the routine will return the lowest-precision numeric type to which all the specified axis arrays may be converted without unnecessary loss of information.

So long as suitable access is available (see §[*]), the numeric type of an axis array may be changed at any time. If the array is in a defined state when this occurs, its values will be converted to the new type and will not be lost--the array may be reset beforehand (e.g. using NDF_AREST) if its values are not to be retained. A component list and/or an IAXIS value of zero may also be used. Thus, the following call would ensure that all of an NDF's axis centre and width values were stored in double-precision arrays:

      CALL NDF_ASTYP( '_DOUBLE', INDF, 'Cen,Wid', 0, STATUS )

Note that the numeric type attribute of an axis array exists regardless of the array's state. A call such as that above can therefore be made before any axis values are assigned and will ensure that arrays of the required type are used when values are later assigned to them.



next up previous
Next: The Storage Form of Axis Arrays
Up: AXIS COMPONENTS
Previous: Axis Normalisation Flags


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