So long as the necessary access is available (see
§), the full type of an NDF's data
and variance components may be explicitly set when required,
thereby altering
the precision with which their values are stored.
This may be done using the routine NDF_STYPE.
For instance:
CALL NDF_STYPE( '_REAL', INDF, 'Data', STATUS )
would change the type of an NDF's data component to `_REAL'. This process will retain pixel values which may already be stored in the affected component; i.e. if these values are defined, then they will be converted to the new type and will not be lost. Of course, this may not always be needed, so it is possible to arrange for existing values to be disposed of, if necessary, in order to avoid the cost of converting the pixel values. This is done by calling NDF_RESET to reset the component's values to an undefined state prior to changing its type, thus:
CALL NDF_RESET( INDF, 'Data', STATUS )
CALL NDF_STYPE( '_REAL', INDF, 'Data', STATUS )
No attempt will then be made by NDF_STYPE to convert individual pixel values, so changing the type of an array component becomes a relatively inexpensive operation. Note that no harm is done by calling NDF_RESET in this way even if the component's state is already undefined.
NDF_STYPE will also accept a list of components and will set them all to the same type. For instance:
CALL NDF_STYPE( 'COMPLEX_DOUBLE', INDF, 'Data,Variance', STATUS )
would set both the data and variance components of an NDF to be of type `COMPLEX_DOUBLE' (i.e. to have real and imaginary parts, both stored as double-precision numbers). Changes may be made freely between non-complex and complex types, and conversion of pixel values will be performed if these values are defined; either an imaginary part filled with zeros will be supplied, or the imaginary part will be discarded, as appropriate.