Mask a region of a data grid AST_MASKX
You should use a masking function which matches the numerical type of the data you are processing by replacing
X
in the generic function name AST_MASKX
by an appropriate 1- or 2-character type code. For example, if you are masking data with type
REAL, you should use the function AST_MASKR (see the "
Data Type Codes"
section
below for the codes appropriate to other numerical types).
The number of inputs for this Mapping (as given by its Nin attribute) should match the number of axes in the supplied Region (as given by the Naxes attribute of the Region). The number of outputs for the Mapping (as given by its Nout attribute) should match the number of grid dimensions given by the value of NDIM below.
For types of Region such as PointList which have zero volume, pixel centres will rarely fall exactly within the Region. For this reason, the inclusion criterion is changed for zero-volume Regions so that pixels are included (or excluded) if any part of the Region passes through the pixel. For a PointList, this means that pixels are included (or excluded) if they contain at least one of the points listed in the PointList.
Note that LBND and UBND together define the shape and size of
the input grid, its extent along a particular (J’
th) dimension being
UBND(J)-LBND(J)1.
They also define the input grid’
s coordinate system, each pixel having unit
extent along each dimension with integral coordinate values at its centre.
The storage order of data within this array should be such that the index of the first grid dimension varies most rapidly and that of the final dimension least rapidly (i.e. normal Fortran array storage order).
On exit, the samples specified by INSIDE are set to the value of VAL. All other samples are left unchanged.
A value of zero will be returned if this function is invoked with the global error status set, or if it should fail for any reason.
An error will be reported if the overlap of the Region and the array cannot be determined.
D: DOUBLE PRECISION
R: REAL
I: INTEGER
UI: INTEGER (treated as unsigned)
S: INTEGER2 (short integer)
US: INTEGER2 (short integer, treated as unsigned)
B: BYTE (treated as signed)
UB: BYTE (treated as unsigned)
For example, AST_MASKD would be used to process DOUBLE PRECISION data, while AST_MASKS would be used to process short integer data (stored in an INTEGER2 array), etc.
For compatibility with other Starlink facilities, the codes W and UW are provided as synonyms for S and US respectively (but only in the Fortran interface to AST).