### ARD_WORK

Convert an ARD description into a pixel mask

#### Description:

This routine returns an array which contains a positive value for all pixels within the areas specified by a given ARD description, and zero for all other pixels.

#### Invocation

CALL ARD_WORK( IGRP, NDIM, LBND, UBND, TRCOEF, CONCAT, REGVAL, MASK, LBNDI, UBNDI, LBNDE, UBNDE, STATUS )

#### Arguments

##### IGRP = INTEGER (Given)
A GRP identifier for the group holding the ARD description.
##### NDIM = INTEGER (Given)
The number of pixel axes in the mask array.
##### LBND( NDIM ) = INTEGER (Given)
The lower pixel index bounds of the mask array.
##### UBND( NDIM ) = INTEGER (Given)
The upper pixel index bounds of the mask array.
##### TRCOEF( 0:NDIM, NDIM ) = REAL (Given)
The coefficients of the mapping from application coordinates (i.e. default user coordinates) to pixel coordinates. If the first element is equal to VAL__BADR, then a unit mapping is used. This argument is ignored if a call to ARD_WCS has already been made to establish WCS Information.
##### CONCAT = LOGICAL (Given)
If .TRUE., then an INPUT keyword is inserted at the start of the ARD description so long as the ARD description does not already contain any INPUT keywords. If .FALSE., the ARD description is left as supplied.
##### REGVAL = INTEGER (Given and Returned)
A positive integer to use to represent the first keyword in the ARD description (excluding INPUT keywords). An error is reported if the value 1 is supplied. If the supplied value is negative or zero, then the value used is one greater than the maximum pixel value supplied in MASK (except that 2 is used if the maximum mask value is 1 or less). On return, REGVAL holds one more than the largest value used to represent any of the keywords in the ARD description.
##### MASK( $\ast$ ) = INTEGER (Given and Returned)
The mask array. Any negative values in the supplied array are treated as zero.
##### LBNDI( NDIM ) = INTEGER (Returned)
The lower pixel bounds of a box which encompasses all internal pixels. If there are no internal pixels in the returned mask, each lower bound is returned greater than the corresponding upper bound.
##### UBNDI( NDIM ) = INTEGER (Returned)
The upper pixel bounds of a box which encompasses all internal pixels.
##### LBNDE( NDIM ) = INTEGER (Returned)
The lower pixel bounds of a box which encompasses all external pixels. If there are no external pixels in the returned mask, each lower bound is returned greater than the corresponding upper bound.
##### UBNDE( NDIM ) = INTEGER (Returned)
The upper pixel bounds of a box which encompasses all external pixels.
##### STATUS = INTEGER (Given and Returned)
The global status.