EventFiles_doc
The provided flag string must be a hexcode. Note that the default sense of the selection is exclusionary: an event with a FLAG value which has any bit set which is also set in the supplied flag mask, will be rejected. This action is reversed if parameter flag_invert is set to "yes".
The pattern parameter of evtool accepts an integer in the range 1 to 15 inclusive. This is interpreted as a 4-bit mask: 1 bit for each pattern desired. It is an inclusive selection, thus e.g. pattern=6 will choose doubles (bit 1) and triples (bit 2) but not singles (bit 0) and quads (bit 3) - since 6_decimal = 0110_binary.
If the name of a mask file is supplied, the file is expected to be FITS with a CCD-sized image in its primary HDU. The image should define a mask to select pixels of the CCD to pass to the output. The data type of the mask may be any FITS-standard numerical value except 8-byte integer. Non-zero values are interpreted as true, zero values as false. With parameter rawxy_invert left at its default value of 'no', true pixels are interpreted as CCD pixels to retain; vice-versa if rawxy_invert is set to 'yes'.
If instead a list of rectangle limits is supplied, the given bounds are taken to be event-inclusive for rawxy_invert="no" and event-exclusive for rawxy_invert="yes". Thus for example filtering with rawxy='1 384 40 65' and rawxy_invert='no' will exclude any event with RAWY<40 or RAWY>65, whereas simply flipping the value of rawxy_invert to 'yes' will exclude any event with 40≤RAWY≤65.
If the parameter is left unset, no RAWX/Y filtering is performed.