Extracting Science Event Data
As described in the Data Files chapter, science event files contain irregularly spaced
time-stamped event words which, in the case of the PCA, are interspersed at regular time intervals with various EDS flags (also known as clock events). This means that extracting light curves and spectra from an event file involves removing the clock events, and, if desired, picking a subset of the valid events, e.g. data from PCU0 only. In practice, this entails defining a bitmask: a binary string (or set of strings) which the event words in the file must match in order pass through extraction.
Seextrct applies but does not define bitmask selections, so another program, sefilter, must be run before the extraction. This caveat applies to:
- All PCA and HEXTE data if you want to apply a particular bitmask, e.g. to pick out events from a single PCU or HEXTE detector.
- All PCA event mode configurations except Good Xenon regardless of whether you want to apply a particular bitmask (to remove the clock events - Good Xenon data files don't have clock events).
This section is split into two. The first, immediately following, covers running sefilter. The second covers running seextrct. As for the corresponding section on saextrct, a fully worked example is given along with some data reduction scenarios.
Defining Bitmasks with Sefilter
Before running sefilter, it's a very good idea to review the sections in the PCA Issues chapter that describe the various event-mode configurations, namely, Good Xenon and Generic event. Revise, too, the footnote on DDL. And it almost goes without saying that you should type fhelp sefilter.
Sefilter is a Perl script that helps you create an ASCII bitmask filter. The script then uses the bitmask to run either of the following:
- fselect to create a single bitmask-filtered event file.
This is the only valid option if the bitmask includes alternatives, e.g. if you want to select events from either PCU0 anode X1L or PCU0 anode X1R (i.e. the top layer of PCU0). It may also be used if you want to create an intermediate filtered event file.
- seextrct to create bitmask-filtered light curves and spectra.
Seextrct, unlike fselect, cannot implement a bitmask that contains alternatives. However, for simple bitmasks, e.g. events from PCU0 and PCU1, sefilter offers the choice of creating the filtered event file with fselect or of going straight to seextrct to create light curves and spectra.
An example of using sefilter follows, but please note the following:
Bitmask files are simple, containing only the coded selection criteria and no record of their origin. Moreover, neither fselect nor seextrct can check whether a given bitmask is sensible. Fortunately, sefilter contains built-in safeguards: after creating a valid bitmask, sefilter initiates either fselect or seextrct, whichever is appropriate, to apply the filter.
Bitmasks contain a prefix (b for binary, h for hex, o for octal - all RXTE bitmasks are binary) followed by a string of zeroes, ones or x's. The x is a wild card: for binary bitmasks it means "0 or 1". When you run sefilter, not selecting a particular token is equivalent to leaving all its values as x's. Practically, this means that if, say, you want events from all five PCU, you should not make a selection based on the D-token which would otherwise enable you to single out a particular PCU.
By default, and if no other selections are specified, sefilter creates a bitmask for PCA data which will select only good science events, i.e. those with the M[1]{1} marker or M-token. It is an ASCII file containing a line like
Event == b1xxxxxxxxxxxxxxx.
Although, for some configurations, channel information is contained in the bitmask, selection by channel is not performed via sefilter. Seextrct is used instead.
Example of using sefilter
Here, we'll use sefilter to generate a bitmask corresponding to the top layers of all the PCU. The input file, E_1ms_128M_0_8s.list is a list of data files in the E_1ms_128M_0_8s configuration, hence the @ sign. In this example, user input is in boldface.
rufus [41] [day] test: sefilter
Enter SE FITS file for filtering:[]@E_1ms_128M_0_8s.list
Enter the M-token to be processed (M[1]{1}):[M[1]{1}]
Enter the column name to be operated upon (Event):[Event]
Enter the output bitfile name to contain processed boolean expression:[]top.bit
Defaults are entered for the
M-token and column name. We've named the filter file itself top.bit.
Beginning generation of filter description.
###########################################
This file contains a Z-token, specifically:
Z[D[0]&E[X1L],D[0]&E[X1R],D[0]&E[X2L],D[0]&E[X2R],D[0]&E[X3L],D[0]&E[X3R],D[1]&E
[X1L],D[1]&E[X1R],D[1]&E[X2L],D[1]&E[X2R],D[1]&E[X3L],D[1]&E[X3R],D[2]&E[X1L],D[
2]&E[X1R],D[2]&E[X2L],D[2]&E[X2R],D[2]&E[X3L],D[2]&E[X3R],D[3]&E[X1L],D[3]&E[X1R
],D[3]&E[X2L],D[3]&E[X2R],D[3]&E[X3L],D[3]&E[X3R],D[4]&E[X1L],D[4]&E[X1R],D[4]&E
[X2L],D[4]&E[X2R],D[4]&E[X3L],D[4]&E[X3R]].
We have 5 bits for this token.
So this token can take on values from 0 --> 31
The Z-token is SPECIAL. So we will deal with it in detail.
Number of Z-tokens is 30
D[0]&E[X1L] == 0 D[2]&E[X2R] == 15
D[0]&E[X1R] == 1 D[2]&E[X3L] == 16
D[0]&E[X2L] == 2 D[2]&E[X3R] == 17
D[0]&E[X2R] == 3 D[3]&E[X1L] == 18
D[0]&E[X3L] == 4 D[3]&E[X1R] == 19
D[0]&E[X3R] == 5 D[3]&E[X2L] == 20
D[1]&E[X1L] == 6 D[3]&E[X2R] == 21
D[1]&E[X1R] == 7 D[3]&E[X3L] == 22
D[1]&E[X2L] == 8 D[3]&E[X3R] == 23
D[1]&E[X2R] == 9 D[4]&E[X1L] == 24
D[1]&E[X3L] == 10 D[4]&E[X1R] == 25
D[1]&E[X3R] == 11 D[4]&E[X2L] == 26
D[2]&E[X1L] == 12 D[4]&E[X2R] == 27
D[2]&E[X1R] == 13 D[4]&E[X3L] == 28
D[2]&E[X2L] == 14 D[4]&E[X3R] == 29
After reading the datafile headers, sefilter prints on the screen the part of the TEVTB2 keyword describing the selectable parts of the template. For this particular configuration,