1 Introduction to QUALITY

A QUALITY structure is one of the standard components of an NDF structure, and is described fully in SUN/33. Briefly, if an NDF has a QUALITY component which is in a defined state, then each pixel within the NDF DATA component has a corresponding value in the QUALITY component. Currently, each QUALITY value consists of an unsigned byte (i.e. 8 bits). In Fortran the least-significant bit is usually called Bit 0 and the most significant bit is usually called Bit 7. Within the IRQ package the least-significant bit is called Bit 1 and the most-significant bit is called Bit 8. Each bit within the QUALITY value can be used to indicate if the corresponding pixel in the DATA component holds some specific quality. For instance, Bit 3 of the QUALITY component may be used to indicate if any DATA pixels are saturated. A particular pixel in the QUALITY component would have Bit 3 set (i.e. equal to 1) if the corresponding DATA pixel is saturated, or cleared (i.e. equal to 0) if the corresponding DATA pixel is not saturated.

Another option for flagging saturated data is to replace saturated DATA pixel values with a ‘bad’ (or ‘magic’) value. This has the disadvantage that the datum is permanently destroyed by being flagged, and also there is no distinction between data values thst are set bad because of the fact they were saturated, and pixels set bad for any other reason.

SUN/33 doesn’t specify how the facilities of the QUALITY component are to be used, and many possibilities exist. Obviously some co-ordination between applications is needed so that different applications interpret the QUALITY values in a consistent manner ({emphi.e. using the above example, later applications must know that Bit 3 is a saturation flag). The IRQ package provides a set of routines for doing this.

You may be are wondering about the name IRQ. The library was originally developed for the IRAS90 package, and its subroutine libraries had IR prefix.