next up previous
Next: EXTENSIONS
Up: THE QUALITY COMPONENT IN MORE DETAIL
Previous: Why Ignoring the Quality Component Works

Controlling Automatic Quality Masking  

The automatic quality masking action described above is controlled by a logical quality masking flag associated with each NDF identifier, and this flag can be manipulated if necessary to modify the default behaviour.

When an NDF identifier is first issued, its quality masking flag is set to .TRUE.. In this state, all access to the NDF's data and variance components via this identifier will implicitly take account of any quality information present, as described above. So long as no explicit access to the NDF's quality array is made, the quality masking flag remains set to .TRUE.. Thus, an application which chooses to completely ignore quality values will obtain the desired automatic quality masking action.

However, if explicit access to the quality array is obtained (e.g. by using the routines NDF_MAP or NDF_MAPQL), the flag will simultaneously be reset to .FALSE.. It is then assumed that the application intends to process quality values explicitly, so access to other NDF components will no longer take account of quality values. The quality masking flag returns to .TRUE. once direct access to the quality array is relinquished (by unmapping it using NDF_UNMAP). An application which intends to process quality values explicitly should therefore normally map the quality array first, so that subsequent access to other NDF components does not involve further implicit access to the quality component. The following sequence of operations might be typical:

      CALL NDF_MAP( INDF, 'Quality', '_UBYTE', 'READ', QPNTR, EL, STATUS )
      CALL NDF_MAP( INDF, 'Data', '_REAL', 'READ', DPNTR, EL, STATUS )

      ...

      <process the data and quality information>

      ...

      CALL NDF_UNMAP( INDF, 'Quality,Data', STATUS )

Here, the quality masking flag is set to .FALSE. by the first call to NDF_MAP, which accesses the quality component explicitly. The subsequent call to map the data component therefore ignores the quality values. Finally, the quality masking flag is returned to .TRUE. by the final call to NDF_UNMAP which unmaps the quality array.

The value of the quality masking flag associated with an NDF identifier may be determined at any time with the routine NDF_QMF:

      LOGICAL QMF

      ...

      CALL NDF_QMF( INDF, QMF, STATUS )

and a new value may be set with the routine NDF_SQMF:

      CALL NDF_SQMF( QMF, INDF, STATUS )

This allows the normal behaviour to be over-ridden if necessary. For instance, if direct access to an NDF's data component is required without automatic quality masking occurring, then masking could be disabled as follows:

      CALL NDF_SQMF( .FALSE., INDF, STATUS )
      CALL NDF_MAP( INDF, 'Data', '_REAL', 'UPDATE', PNTR, EL, STATUS )

§[*] contains an example of this technique in use.



next up previous
Next: EXTENSIONS
Up: THE QUALITY COMPONENT IN MORE DETAIL
Previous: Why Ignoring the Quality Component Works


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