next up previous 210
Next: Bounding Boxes
Up: Interpretation of ARD Descriptions
Previous: Pixels Included in Several Regions


Supplying an Initial Pixel Mask

It may sometimes be necessary for applications to combine together pixel masks created from different ARD descriptions. To do this, the ARD descriptions should be processed in turn by ARD_WORK and they should use the ``INPUT'' keyword. This keyword refers to the pixel mask supplied to routine ARD_WORK in argument MASK; if a pixel holds a positive value in the supplied mask then the INPUT keyword is notionally .TRUE., and is notionally .FALSE. if the pixel value is zero or negative. This keyword can be used at any point in an ARD description, and can be included any number of times. A simple example of its use could be:

      .NOT. INPUT

which inverts the supplied mask. If the ARD description does not include any references to the INPUT keyword, then the application can force an INPUT keyword to be inserted at the start of the ARD description by supplying a .TRUE. value for ARD_WORK argument CONCAT. For instance, if CONCAT is supplied .TRUE., then the ARD description:

      BOX( 0, 0, 10, 10 ) .OR. CIR( 0, 0, 10 )

becomes

      INPUT BOX( 0, 0, 10, 10 ) .OR. CIR( 0, 0, 10 )

There is now no operator between the INPUT and BOX keywords, and so ARD inserts an implicit .OR. so that the final ARD description used is:

      INPUT .OR. BOX( 0, 0, 10, 10 ) .OR. CIR( 0, 0, 10 )

If the supplied ARD description had started with an operator, for instance:

      .AND.( BOX( 0, 0, 10, 10 ) .OR. CIR( 0, 0, 10 ) )

then there would be no need to insert an implicit .OR. after the INPUT keyword, and so the final used ARD description would be:

      INPUT .AND.( BOX( 0, 0, 10, 10 ) .OR. CIR( 0, 0, 10 ) )

To re-iterate, an INPUT keyword is inserted at the start of the ARD description only if the ARD description as supplied contains no INPUT keywords, and the ARD_WORK argument CONCAT is supplied .TRUE.. If either of these conditions is broken then the ARD description is left as supplied.


next up previous 210
Next: Bounding Boxes
Up: Interpretation of ARD Descriptions
Previous: Pixels Included in Several Regions

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