Date: Tue, 5 May 1998 10:12:04 -0400 (EDT) From: "Kathryn A. Flanagan" I have found the following information concerning the STATUS flag. WHY EXAMINE THE STATUS MASK? The status mask has 32 bits as defined at the bottom of this memo. In examining XRCF data, I see that in cases where the pulse height has saturated (value 255), these events must be rejected for proper imaging. The same is true when individual amplifiers have saturated (value 4095). However, the events that are rejected in my data are true xray events and need to be considered in applications where the total count of xray events is needed. (This may be likened to the problem of deriving an effective area that is linked to ACIS grades.) My expectation is that the pipeline processing and data model will be capable of addressing this, but here is the "workaround" that I have come up with for the present. STATUS MASK WORKAROUND: (1) Use emacs to edit the fits file. Change from '1J' to '32X' under TFORM25. Check that the new file has the same size as the original file. Original file: hrc_ghhiea7031i001n000_evt.fits New file: modheader7031.fits (2) Use fselect (an ftools task) to apply a bit mask to the status. I can apply the criterion that bits 8-21 are unset, and that other bits are arbitrary by using a wildcard, x. Type plist fselect to view your parameters, and pset fselect to set them. Here are the fselect parameters for the case I have described: Parameters for /nfs/wiwaxia/h2/kaf/pfiles/fselect.par infile = modheader7031.fits[2] Name of FITS file and [ext#] outfile = good7031.fits Name of output FITS file expr = STATUS .eq. bxxxxxxxxxx00000000000000xxxxxxxx Selection Expression (index = ) Name of INDEX file (histkw = yes) Print a history keyword (copyall = yes) Copy all other extensions? (keycopy = yes) Copy all keywords from specified extension? (clobber = no) Overwrite existing output file? (nrows = 128) Buffer size in rows for input file (mode = ql) Then run fselect. Alternatively, on the command line you can type (being sure to include the quotes): fselect "modheader7031.fits[2]" good7031.fits "STATUS .eq. bxxxxxxxxxx00000000000000xxxxxxx" You can change the bit mask to include events with saturated pulse height (bit 17 set to 1) to separate out these events, or refine your selection criteria as desired. (3) To peruse the output file, type fv good7031.fits. You are interested in index 3 (events). Select "view table". Scroll to the last coulmn on the right, "STATUS". Click on the box "expand". This will tell you which bits of the STATUS are set. The BIT NUMBERING IS NOT THE SAME. As shown below, if you have set bit 17 to 1, in your bitmask, then fv will show bit number 15 as set to 1. Here is the "map" for how I believe the numbering should be interpreted: ORDER IN WHICH TO APPLY YOUR BIT MASK IN FSELECT- from left to right, you are marking the bits below whose definition is giving at the bottom of this page. > * |3|3|2|2|2|2|2|2|2|2|2|2|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0| > * |1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0| NUMBERING AS SHOWN IN fv (make a one-to-one correspondance with the bit position above, i.e., bit 04 on the bit mask, which is 5th from the right, is labeled 28 under fv.) > * |0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|1|1|2|2|2|2|2|2|2|2|2|2|3|3|3| > * |1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2| DEFINITION OF BITS and comments (supplied by Mike Juda and Dan Dewey): > * 31 - 26 - unused > * 25 E status - V axis not triggered > * 24 E status - U axis not triggered > * 23 V status - V axis center blank event > * 22 V status - U axis center blank event > * 21 V status - V axis width exceeded > * 20 V status - U axis width exceeded > * 19 V status - shield PMT active > * 18 V status - spare > * 17 V status - upper level discriminator exceeded > * 16 V status - lower level discriminator (not?) exceeded > * 15 P status - Hot spots > * 14 P status - fine pos > * 13 P status - V center (bad amps) > * 12 P status - U center (bad amps) > * 11 P status - pha ratio > * 10 P status - zero psum > * 09 P status - grid ratio > * 08 P status - zero sum > * 07 - 00 - Data sys stats - T.B.D. > * > * STATUS MASK > */ > > Bits 8-15 are set by ground software based on the quality of the event > information and should all be zero for a "good" event (bit 11 - pha ratio > could be set for a good event due to some peculiarities of the hardware). > > Bits 16-25 are derived from the hardware "event" and "veto" status telemetry > bits. It is OK for bits 22 and 23 to be set as the center blank region is > arbitrary.