RXTE GOF |
Using the Latest Pcabackest Recipes from the RXTE Cook Book |
RXTE FAQ |
---|
- What's New with the Background Models? updated 2002 July 09 with information on latest FTOOLS release (5.2)
- Introduction
- Using Pcabackest
- Problems and Remedies
- Notes
July 9, 2002: FTOOLS 5.2
was released June 25, 2002 and includes
updated tools for background estimation using the recently released
improved PCA background models (March 2002). New bright and faint model
files, with separate model components combined into a single file, can
be downloaded from the
PCA Digest page,
which also includes a short
discussion of the updated tools as well as
the improvements over the old models.
Detailed practical advice for users of the new RXTE PCA background
models
can be found on
Craig Markwardt's documentation page. Craig includes
a helpful discussion of how to handle PCU0 background estimation, but
the
current version of his page was written before the latest FTOOLS
release.
Pcabackest is an ftool that produces synthetic background data by matching the background conditions of your observation with those in various model files. These model files contain actual background observations sorted by quantities such as the position of the spacecraft with respect to the South Atlantic Anomaly.
The output of pcabackest is in the form of data files very similar in structure to Standard2 data files. They can be put through saextrct to produce background light curves and spectra. Though the background data are in Standard2 format, the count rates apply to the observation, not to that mode. This recipes uses an example where the background will be subtracted from event mode data.
Pcabackest is very much a work in progress: both the program and its models are being continually revised. The current version (v3.0) was released with FTOOLS version 5.2. To find the appropriate models for your data, please see the PCA Digest page.
(following the directions under fhelp xtefilt or in the recipe for creating XTE filter files). This will calculate several new quantities used to create and evaluate the
background model.
This recipe will run through an example of using pcabackest to estimate a background to be applied to E_62us_64M_0_1s_L1R1 mode data. Assuming a light curve and spectrum have already been extracted from these data files (following the recipe for event mode spectra), we now go back to XDF and find the Standard2 data files which are always present, whatever other modes you may have requested. For each Standard2 data file, you can run pcabackest to produce a corresponding background data file from which you can then extract lightcurves and spectra. This can be done one file at a time with pcabackest or all at once using the script runpcabackest; the inputs are almost all the same, with the exception of a few output options in the latter:
To use the combined mission-long faint model, for instance,
get the following modelfile:
and enter the name of this file at the pcabackest "modelfile" prompt.
If you will be using the background spectra on anything but Standard2 binned data, as in this case with event mode data, you will have to expand the background spectra to the full 256 channels. Then the extracted spectra can be rebinned using rbnpha with the binfile from rddescr. If you apply the EDS Gain Correction, then the spectra will automatically be expanded to 256 channels, so this prompt does not appear.
You will then see the script call pcabackest with the first of the data files in the list you gave runpcabackest. It will go to CALDB and find the model files and apply each to every good xenon column in the Standard2 file. When it is done, it will tell you what it output and ask:
We now run saextrct on the background data files to extract the spectra and lightcurves corresponding to those extracted from the data. Whether the data are Standard2, event, or another mode, you should extract the background using the same selection and binning criteria, i.e. the same GTIAND file, the same number of detectors and layers, the same time or channel filters, etc.
In this case, we want to apply a background to the event mode E_62us_64M_0_1s_L1R1; this has 62 us timing, 64M_0 channel binning, and layer one only. It is the last which forces us to run saextrct from the command line. We need a column list corresponding to only the layer 1 anodes of the PCU that were on during the observation. Suppose we have checked the filter file and plotted the columns PCU0_ON, PCU1_ON, etc., and determined that PCU3 had been off for the entire observation; then our column list looks like:
You will also want to only extract those channels which are included in your event mode. If you "fkeyprint
In our example, the resulting spectrum will have the full 256 channel binning (though in this case, the last five will be empty), so you will have to rebin it according to the binning in your data file. Take the spectrum extracted from the event data, use pcarsp to create the appropriate response matrix (in the process, this script will set the gain in the header of the pha), and then use rddescr to read the PHA header and create a file containing the binning information, "chan.txt" for instance. Then you can use this channel information file with the hidden parameter "binfile" in the tool rbnpha:
A quick and qualitative way to check your background is to compare the spectrum to that of the data at the higher PCA energies. Above 20-30 keV, the spectrum is dominated by the background. Enter the two spectra into XSPEC as two data series, with the same response entered for both, and plot them together. You should see that above 30 keV, they lie right on top of one another. If there is an offset, then there is something mismatched in the way the two spectra were extracted, and you should check that you selected the appropriate detectors and anodes, channels, time intervals, etc.
Note: while pcabackest does not currently compute systematic errors, you may want to apply a value yourself using fparkey to change the SYS_ERR keyword in the PHA file. You can use one percent as a simple estimate or make your own determination. If your source is weak and not especially hard, for instance, you do not expect any counts below 10 keV in the third layer. Extracting only this layer and comparing the background to the data will give you an idea of how large the errors are.
If your background spectrum appears to be slightly overestimating or underestimating (apparent in the highest energy band where there are no source counts), it is most likely due to uncertainties in the activation model. (A large offset is probably just due to extracting the wrong number of anodes or detectors.) Immediately after SAA passage, the activation in the PCA is falling rapidly, but the rate of this fall is not modeled with great precision. You may see variations in the net light curve which are due solely to the activation component of the background estimation, and this may correspond to a total over- or under-estimation of background counts which is apparent when you plot the two spectra (data and background estimation) on top of one another. Until the activation model improves, there are two work-arounds for this problem.
Make one file, "setcor.xcm", with the commands to re-normalize the correction file:
What's New with the Background Models?
Introduction
Using Pcabackest
% runpcabackest
This perl script will take a series of input files via @filename
and run pcabackest multiple times, creating multiple files with the same
name as the input file with _$outsuffix appended to the input name ready
to be input into saextrct for farther analysis.
Running RUNPCABACKEST version 4.0
===========================================
List of Standard mode 2 Science array FITS files (@filename):[]@std2.xdf
Output file which will contain the LIST of output files?:[]bkg.xdf
Suffix appended to the output background files (after underscore _):[]bkg
Here, simply input the list of Standard2 files rather than each individual file. The script then asks for the name of the list of output files, each of which will have the same name as the corresponding Standard2 file followed by a suffix you specify.
XTE Filter file:[]obs1.xfl
The filter file must cover the time range in the input Standard2 data files, so if using the script runpcabackest and giving a list of files which spans more than one Obs. Id., you must us a merged filter file which covers all of the time. (Remember to use "fmerge lastkey=TSTOP" to combine filter files.)
PCA Background model file:[] pca_bkgd_cmfaintl7_eMv20020201.mdl
We no longer recommend the CALDB option for this parameter. The Q6 models which were in CALDB are the oldest models and have since been made obsolete for most data sets. The currently recommended models can be found in the anonymous ftp area at ftp://legacy.gsfc.nasa.gov/xte/calib_data/pca_bkgd/. Information about which models to use for which data is posted on our PCA Digest page. Note that the newly available CM model-files allow you to
download one single file that contains within it the separate components
of the model. Mission-long bright and faint combined model files, i.e.,
pca_bkgd_cmfaintl7_eMv20020201.mdl, and
pca_bkgd_cmbrightvle_eMv20020201.mdl are also accepted by
the latest pcabackest.
pca_bkgd_cmfaintl7_eMv20020201.mdl
Seconds between successive estimates:[]16
The background estimator uses count rates found in the Standard2 data files and therefore has at best 16 second resolution. If you want to subtract a light curve at less than 16 second binning, you can still do so using lcmath. This tool will take a total light curve binned finer than 16 seconds and subtract the corresponding value of the coarser-binned background.
Include individual xenon layer spectra? (Yes, No):[]yes
If you will wish to select by layer in the extractor, you must tell pcabackest to include individual xenon layer spectra. This will produce a column for each anode, just as is found in Standard2, which can then be extracted separately in saextrct. Otherwise, each PCU will have only one column. In this example, we want to apply the background to an event mode which only includes layer 1, so we will have to select the appropriate columns when we saextrct the background files. So we must answer yes to this prompt.
Correct for PCU Xenon gain variations? (Yes, No):[no]yes
EDS gain correction file (CALDB) :[]caldb
or
Correct for PCU Xenon gain variations? (Yes, No):[]no
Expand xenon layer spectra to 256 channels? (Yes, No):[]yes
If you will use the background to analyze Standard1, Standard2, or Good Xenon modes, you should not apply the gain correction. For other modes, the gain correction is applied to the data on board the satellite, because data from the various PCU's are combined before being sent down. This function of pcabackest is to adjust the background in the same way only if it is to be compared to data from modes where the correction has already been applied, e.g. binned or event modes. For this example applied to an event mode, answer "yes" to apply the gain correction, and enter "CALDB" for the EDS gain correction file.
PCA SAA passage history file:[none] pca_saa_history
This does not apply if you are using the bright source model in Epoch 1
or Epoch 2.
ALL other users must include the appropriate file pca_saa_history;
this file will be updated approximately daily and is found on the ftp site.
Compute systematic error estimate? (Yes, No):[]no
For this version, answer "no" to compute the systematic error estimate. This is under development and not currently useful.
Update Parameter file for PCABACKEST? (Yes, No):yes
PCABACKEST parameter file updated.
which will update the parameter file for pcabackest with the inputs you just used.
X1LSpecPcu0
X1RSpecPcu0
X1LSpecPcu1
X1RSpecPcu1
X1LSpecPcu2
X1RSpecPcu2
X1LSpecPcu4
X1RSpecPcu4
We then input this list (preceded by '@') for the columns to be accumulated.
% rbnpha binfile=chan.txt
Please enter PHA filename:[]bkg.pha
Please enter output filename:[] bkg_rbn.pha
** rbnpha 2.1.0
** rbnpha 2.1.0 completed successfully
Now you have the correct background PHA file and light curve to apply to your data.
Problems and Remedies
TIME_SINCE_SAA > 30 || TIME_SINCE_SAA < 0
would filter out data within 30 minutes of the peak of the SAA passage. Be advised that this formula is not meant to be taken and applied blindly. It is simply an example which may not work for your particular observation. Try using different bounds for TIME_SINCE_SAA and compare the resulting times with your light curve to see how well they reflect what you judge to be good times. It will take some adjusting to get the result you want.
XSPEC> data 1:1 layer1_src 2:2 layer2_src 3:3 layer3_src
XSPEC> back layer1_bkg layer2_bkg layer3_bkg
XSPEC> corfile layer1_act layer2_act layer3_act
XSPEC> resp pca_LR1_961101.rsp pca_LR2_961101.rsp pca_LR3_961101.rsp
The idea is to fit a model to the data (using the band where your source dominates the background) and in the process to find the normalization factor for the correction file which gives the best fit (using the highest energy band to minimize the efficiency for cosmic X-rays.) This involves alternating fitting the model with re-normalizing the correction; you can do this by hand or use a command file such as in the following example:
notice 1-3:60.-90.
ignore 1-3:0.-60. 90.-**
recornrm 1
recornrm 2
recornrm 3
and another file, "refit.xcm":
notice 1:2.5-50.
notice 2-3:8.-50.
ignore 1:0.-2.5 50.-**
ignore 1-3:0.-8. 50.-**
fit
This example fits the model from 2.5-50 keV, and will re-normalize using 60-90 keV, but these values will depend on your source. So define your model and make a preliminary fit with the normalization still at the default of zero. Then alternate running "@setcor.xcm" and "@refit.xcm" until they converge.
Notes
If you have a question about RXTE, please send email to one of our
help desks.