Data quality is flagged using the QUALITY system described in SGP38. Each data value has an associated BYTE quality value stored in the QUALITY array. This is masked by preforming a logical AND with the BADBITS mask. If the resulting byte is non-zero (i.e. any 1 in the QUALITY byte matches a 1 in the mask) then quality is bad for that point.
The BADBITS mask is usually set to 11111111 (so that any non-zero QUALITY value will be taken as bad), except in the case of `patched' data (see below).
The following conventions for QUALITY are used within ASTERIX:
a) QUALITY=00000000 => data good b) QUALITY=00000001 => data missing c) QUALITY=00000100 => arithmetic error occurred (e.g. zero divide or log(-ve)) d) QUALITY=01000000 => patched data value (e.g. replaced by interpolated value) e) QUALITY=1******* => IGNOREd data The leftmost quality bit is reserved for temporary flagging of data (e.g. by the IGNORE command) so as to allow selected points to be omitted from processing. This is done by toggling the bit, leaving any other quality code unaffected, so that the previous quality status can be recovered with RESTORE. f) Other bits (2,4,5 and 6) are just generalised `bad' at present.
Note that in the case of patched data (d), the BADBITS mask will be set by the patching software to 10111111, hence patched data are flagged, but will still be regarded as `good' by subsequent software; they can be excluded by resetting BADBITS to 11111111 using the MASK application.
ASTERIX programmers can access the above standard definitions using the QUAL_PAR include file.