next up previous 210
Next: Pixels Included in Several Regions
Up: Values within the Pixel Mask
Previous: Background Pixels

Assignment of Keyword Values

The choice of which positive value to use to represent each keyword in the ARD description is controlled by the REGVAL argument supplied to the ARD_WORK routine. If a positive value is supplied for REGVAL then the first keyword in the ARD description (working from left to right) is assigned the supplied value. Successive values are assigned to the remaining keywords. An error is reported if REGVAL is supplied equal to 1. This is because 1 is reserved to represent background pixels and may not be used to represent keywords.

If a zero or negative value is supplied for REGVAL, then the array of pixel values supplied to ARD_WORK in argument MASK is examined and the maximum value found. This value is incremented by one and used to represent the first keyword in the ARD description (if the incremented value is less than 2, then 2 is used instead). Successive values are assigned to the remaining keywords.

There is one exception to these rules; pixels selected using an INPUT keyword (see section [*]) are assigned the values of the corresponding pixels in the input mask supplied to ARD_WORK, irrespective of the position of the INPUT keyword in the ARD description. The inclusion of INPUT keywords within an ARD description does not effect the integer values used to represent other keywords. Thus if REGVAL is supplied equal to 2 and the ARD description is:

      CIRCLE( 0, 0, 10 ) .AND. ( INPUT .OR. CIRCLE( 0, 10, 10 ) )

then the CIRCLE(0,0,10) region is assigned the value 2 and the CIRCLE(0,10,10) region is assigned the value 3 (i.e. the INPUT keyword is not included in the count of keywords).

On return from ARD_WORK the REGVAL argument will hold a value one larger than the value assigned to the last keyword in the ARD description.



next up previous 210
Next: Pixels Included in Several Regions
Up: Values within the Pixel Mask
Previous: Background Pixels

ARD A Textual Language for Describing Regions within a Data Array
Starlink User Note 183
D.S. Berry
2nd October 2007
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council