The IRQ package uses several different HDS data structures. These are described in this appendix. HDS names are indicated by being placed within square brackets ([ ]), and HDS types are indicated by being placed within angled brackets ( ).
Information describing the quality names which are defined within an NDF is stored in a structure called [QUALITY_NAMES], with HDS type QUALITY_NAMES. This structure can be stored in any extension within the NDF. The components of this structure are shown in the table below.
Component Name | TYPE | Brief Description |
[QUAL] | IRQ_QUAL | Vector of quality name definitions |
[LAST_USED] | _INTEGER | Highest used index within [QUAL] |
[NFREE] | _INTEGER | No. of un-used cells within [QUAL] |
[FREE(NFREE)] | _INTEGER | Vector holding indices of un-used cells in [QUAL] |
The [QUAL] component is a vector in which each cell is a structure holding various items of information needed to define a single quality name. The array has an initial size of 8 but is increased if necessary. There will usually be some unused cells within [QUAL], and the other components of the [QUALITY_NAMES] structure listed in Table 1 are used to locate these unused cells. In particular, [FREE] is a vector which holds the indices of all unused cells within [QUAL]. These indices may appear in any order within in [FREE].
The set of five HDS locators returned by routines IRQ_NEW and IRQ_FIND include locators to each of the four components of the [QUALITY_NAMES] structure, together with a locator for a temporary HDS structure holding a single _INTEGER scalar used to store the cloned NDF identifier.
The information describing each individual quality name is stored in a single cell of the [QUAL] vector. The components within each cell of this array are listed in Table 2.
Component Name | TYPE | Brief Description |
[NAME] | _CHAR15 | A quality name (maximum of |
[FIXED] | _LOGICAL | True if all pixels are in the same state |
[VALUE] | _LOGICAL | The state of all pixels, if fixed |
[BIT] | _INTEGER | QUALITY bit used to store this quality |
[COMMENT] | _CHAR | A descriptive comment for the quality |
If all pixels hold a given quality, or if no pixels hold the quality, then a true value is stored for [FIXED]. A true value is stored for [VALUE] if all pixels hold the quality, and a false value if no pixels hold the quality. In either case, [BIT] is ignored since no QUALITY bit needs to be reserved for the quality name, thus allowing more than eight quality names to be defined simultaneously.
If some pixels do hold the quality but some do not, then a false value is stored for [FIXED] and [VALUE] is ignored. In this case, a QUALITY bit is reserved to represent the quality and its bit number (in the range 1 to 8) is stored in [BIT].
When routine IRQ_COMP is called to compile a quality expression, the resulting information (known as a ‘compiled quality expression’) is stored in a temporary HDS structure. Up to ten compiled quality expressions can exist simultaneously, each being stored in one cell of an array of temporary structures. The identifier returned by IRQ_COMP is just an index within this array. Each cell of the array has an HDS name of [QEXP] and an HDS type of QEXP, and contains the components listed in Table 3.
Component Name | TYPE | Brief Description |
[MASKS] | _INTEGER | A vector of bit masks |
[OPCODE] | _INTEGER | A vector of instruction codes |
Each bit mask held in [MASKS] specifies a set of QUALITY bits which are to be tested as part of the evaluation of a quality expression performed by routine IRQ_SBAD. The instruction codes held in [OPCODE] represent the operations which must be performed on a “First In - Last Out” stack in order to evaluate a quality expression. The sizes of theses vectors are held in common.