next up previous
Next: The Bad-bits Mask
Up: THE QUALITY COMPONENT IN MORE DETAIL
Previous: Purpose of the Quality Component

Accessing the Quality Array Directly  

The main part of the quality component is an array containing an 8-bit (unsigned byte) value for each NDF pixel. Each of the bits in these pixels can be thought of as providing a 1-bit logical mask extending over all pixels and can be used to signify the presence or absence of a particular property at that location.

Thus, if bit 1 (value 1) indicated a contaminated pixel, and bit 2 (value 2) indicated membership of the set of ``sky'' pixels, then a value of 3 (i.e. 1+2) would indicate a contaminated sky pixel, while a value of 0 would indicate an uncontaminated ``object'' pixel. With 8 bits available, quality values can range from 0 to 255.

An application may access the quality array directly by means of the routine NDF_MAP. For instance, the following call maps it for read access in exactly the same way that the NDF's data component might be accessed:

      CALL NDF_MAP( INDF, 'Quality', '_UBYTE', 'READ', PNTR, EL STATUS )

Note that when accessing the quality array in this way a numeric type of `_UBYTE' must always be used. The outcome of using any other type is unspecified, although a meaning might be assigned to such an operation in future.

`WRITE' and `UPDATE' access is also available. When an NDF is first created its quality component is in an undefined state. As with other components, it becomes defined once values have been written to it. Either of the initialisation options `/BAD' or `/ZERO' may also be appended to the mapping mode specification (see §[*]), where `/BAD' causes initialisation to the value 255 (all bits set) and `/ZERO' causes initialisation to zero (all bits clear).



next up previous
Next: The Bad-bits Mask
Up: THE QUALITY COMPONENT IN MORE DETAIL
Previous: Purpose of the Quality Component


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