The subset of pixels to be combined with the Moc are selected using the
" parameters. The way in which the existing Moc and the selected pixels are
combined together is determined by the
An adaptive alogorithm is used to find the HEALPix cells that are inside the selected
area in the pixel array. An initial grid, corresponding to the HEALPix cells at
the order given by the Moc
" attribute, is placed over the pixel
array. Each of these cells is tested at 9 positions (corners, edge-centres and
cell-centre). If all 9 positions are inside the selected area of pixels, then the whole
cell is assumed to be inside. If no positions are inside the selected area,
then the whole cell is assumed to be outside. If there is a mix of inside and
outside positions, the cell is divided into four sub-cells at HEALPix order
, and the same test is applied to each sub-cell in turn. When the HEALPix order reaches
the value of the Moc
" attribute, each cell is tested only at the cell
centre, and is assumed to be inside the selected area if the cell centre is inside the
This process means that contiguous
" in the supplied pixel mask
may be missed if they are smaller than the cell size associated with HEALPix order
If no value has yet been set for the MaxOrder attribute, then this function will automatically set it to the smallest value that results in the cells in the Moc being no larger than half the size of the pixels in the centre of the array. Note, if the value set for attribute MinOrder is greater than or equal to MaxOrder, a value of (MaxOrder-1) will be used in place of MinOrder.
You should use a function which matches the numerical type of the data you are processing by replacing
in the generic function name astAddPixelMaskX
by an appropriate 1- or 2-character type code. For example, if you are procesing data
" , you should use the function astAddPixelMaskF (see the
" Data Type
" section below for the codes appropriate to other numerical types).
AST__AND: The modified Moc is the intersection of the original Moc and the selected pixels.
AST__OR: The modified Moc is the union of the original Moc and the selected pixels.
AST__XOR: The modified Moc is the exclusive disjunction of the original Moc and the selected pixels.
"coordinates within a pixel array (i.e. the first pixel is centred at (1.0,1.0,...) and the distance between pixel centres is 1.0 on both axes). The array supplied for parameter
"is assumed to be a 2-dimensional slice from this array, spanned by the grid axes corresponding to the SkyFrame axes.
"parameter is used to select the required pixels. It can have any of the following values:
AST__LT: select pixels with value less than
AST__LE: select pixels with value less than or equal to
AST__EQ: select pixels with value equal to
AST__NE: select pixels with value not equal to
AST__GE: select pixels with value greater than or equal to
AST__GT: select pixels with value greater than
"section below for a description of the options available. If no flag values are to be set, a value of zero should be given.
If the AST__USEBAD flag is set via the
" parameter, then this value is
used to test for bad pixels in the supplied data array.
The storage order of data within this array should be such that the index of the first grid dimension varies most rapidly (i.e. Fortran array indexing is used).
"header file and may be used to provide additional control over the process. Having selected a set of flags, you should supply the bitwise OR of their values via the
AST__USEBAD: Indicates that there may be bad pixels in the input array which
must be recognised by comparing with the value given for
" . If
this flag is not set, all input values are treated literally.
L: long int
UL: unsigned long int
UI: unsigned int
S: short int
US: unsigned short int
B: byte (signed char)
UB: unsigned byte (unsigned char)
For example, astAddPixelMaskD would be used to process
" data, while
astAddPixelMaskS would be used to process
" short int
" data, etc.
"interface for this function should be used. This alternative interface uses 8 byte integer arguments (instead of 4-byte) to hold pixel indices and pixel counts. Specifically, the argument
"is changed from type
"(defined in header file stdint.h). The function name is changed by inserting the digit
"before the trailing data type code. Thus, astAddPixelMaskX becomes astAddPixelMask8X.