SUN/183.6

Starlink Project
Starlink User Note 183.6

D.S. Berry

2nd October 2007


ARD — A Textual Language for Describing Regions within a Data Array

Version 2.2

Programmer’s Manual



Abstract

The ARD (ASCII Region Definition) system provides a textual language for describing regions within a data array, together with software for converting a textual description into a pixel mask, or plotting it on a graphics device. The textual language is based on a set of keywords identifying simple shapes (boxes, circles, lines, etc.). These keywords can be combined together using Boolean-style operators (AND, OR, NOT, etc.) to create more complex shapes. Data arrays can be multi-dimensional.

Contents

1 Introduction
 1.1 Some Example ARD Descriptions
 1.2 An Example ARD Application
 1.3 Supplying ARD Descriptions to an Application
2 ARD Description Syntax
 2.1 Restrictions on the Order of Fields
 2.2 Group Expression Control Characters
 2.3 Use of GRP Modification Elements
3 Interpretation of ARD Descriptions
 3.1 Values within the Pixel Mask
  3.1.1 Background Pixels
  3.1.2 Assignment of Keyword Values
  3.1.3 Pixels Included in Several Regions
 3.2 Supplying an Initial Pixel Mask
 3.3 Bounding Boxes
4 Coordinate Systems
 4.1 World Coordinate Systems in ARD Version 2
 4.2 Coordinate Handling in ARD Prior to Version 2
  4.2.1 Application Coordinates
  4.2.2 User Coordinates
5 Keywords
6 Operators
7 Statements
8 Compiling and Linking
A Alphabetical List of Routines
B Routine Descriptions
ARD_GROUP – Obtain an ARD description from the environment
ARD_GRPEX – Store an ARD description in a GRP group
ARD_GTWCS – Return a FrameSet connecting pixel and user co-ordinates
ARD_PLOT – Plot the boundary of an ARD description
ARD_PTWCS – Construct an ARD WCS statement and append it to a GRP group
ARD_WCS – Specify WCS information to be used in future calls to ARD_WORK
ARD_WORK – Convert an ARD description into a pixel mask

C Acknowledgements
D Changes Introduced in Version 2.0
E Changes Introduced in Version 2.1
F Changes Introduced in Version 2.2