next up previous 62
Next: Specialist applications
Up: Data Quality
Previous: Data Quality

General-purpose applications

In general-purpose applications, the data-quality values are regarded as a set of 8 independent masks, each of which is 1 bit deep. Whether a given pixel is to be included in the processing or not (i.e. whether it ``bad'') is determined by comparing its quality value with a bit pattern stored in a $<$_UBYTE$>$ data object [BADBITS] within the $<$QUALITY$>$ structure. The following logical expression is evaluated:

\begin{displaymath}BAD = QUALITY \wedge BADBITS \end{displaymath}

where $\wedge$ is the logical AND operation.

Note that if a [BADBITS] mask is zero (i.e. all false), the corresponding data-quality mask is ignored. This can be used to turn off all 8 data-quality masks and allow inspection or processing of the pixels whatever their status. For a single bit, the above expression has the following truth table:


\begin{picture}(110,25)
\put(86,5.5){\makebox(0,0){0}}
\put(86,10.5){\makebox(...
...}
\put(78.5,5.5){\makebox(0,0){1}}
\put(98,15){\makebox(0,0){1}}
\end{picture}


and the overall logical value of BAD is the OR of the results for all eight bits--just one of which has to be TRUE to make the resulting pixel bad.

An example may clarify this. Assume [BADBITS] is 01001010 (where the bits of the binary number are written with the most significant at the left, and are numbered from the right beginning with zero). For this [BADBITS] value, a pixel with a [QUALITY] value of 10100100 is interpreted as non-bad, because bits 2, 5 and 7, which are set in the data-quality value, are not set in [BADBITS]. However, a [QUALITY] value of 10100110 generates a bad value because bit 1, which is set in the data-quality value, is also set in [BADBITS]. If data object [BADBITS] is not present its value is assumed to be to be 00000000, and general-purpose applications will accept as ``good'' any pixel, irrespective of the corresponding data-quality value.

The rules and conventions for the processing of data-quality values and their associated data, taking into account the possible presence of undefined values, are as follows.

Rules
--
Conventions
--

If a [QUALITY] array is present it is assumed that it is to be used to define bad pixels unless:

If [QUALITY] is not present the magic-value method is assumed.

There is no one ideal way of handling data quality in general-purpose routines. Methods will evolve as experience with real applications and data is gained. The main considerations are:



next up previous 62
Next: Specialist applications
Up: Data Quality
Previous: Data Quality

Starlink Standard Data Structures
Starlink General Paper 38
Malcolm J Currie, P T Wallace &
R F Warren-Smith
1989 January 20
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council