RXTE Helpdesk/FAQ RXTE What's New HEASARC Site Map

Combining 3-PCU, 4-PCU and 5-PCU Data
Recipes from the RXTE Cook Book


In March 1996, PCU3 and PCU4 (if you start counting from 0; PCU4 and PCU5 if you count from 1) began to discharge. Since then, these two PCUs - individually or together - are turned off now and again to prevent further damage. Observers, therefore, should not be surprised to find that their data have been collected with three, four or five PCUs, or a combination of these.

The turning on and off of PCUs 3 & 4 is sometimes scheduled and sometimes automatically triggered. Since it obviously has an important impact on data analysis, you should check your observation against the SOF's XTE PCA High-Voltage History. It is also essential to plot the PCU-related columns from the filter file (see below).

Before looking at the recipe, we should first consider how the spectra, background and responses should be combined.

In general, arrival times are lost when a spectrum is extracted, so a spectral fitting program like xspec can't "know" whether the counts in a PHA file were collected when three PCUs were on or five. This means that should only combine spectra when arrival times don't matter, i.e. when the source was in the same spectral state. Of course, this is usually the scientifically prudent thing to do anyway.

Combining the PHA files, source and background, is straightforward: the total counts is the sum of the individual counts, while the total exposure is the sum of the individual exposures. Less obvious, perhaps, is that the corresponding responses should be be combined by weighting them by background-subtracted counts, rather than by exposure. To see why, consider the extreme example of an observation conducted half the time with all five PCUs and half the time with just one PCU. In this case, five times more incoming photons experience the all five PCUs than experience one PCU. Accordingly, the 5-PCU response should carry five times the weight as the 1-PCU response, rather than the equal weight implied by the exposures. Background-subtracted counts are used in the weighting because the response is applied to background-subtracted spectra.

Extracting 3-PCU, 4-PCU and 5-PCU Spectra and light curves

General instructions for extracting spectra can be found in the recipe Reduction and Analysis of PCA Spectra. Here, we simply emphasise the aspects that pertain to mixed-PCU observations.

  1. Examine the filter file: In general, the filter file tells you the status of the satellite and its instruments during your observation and can be used to identify periods of good data. In particular, the column NUM_PCU_ON will tell you how many PCUs were on during the observation. To see which if PCUs were off, plot the columns:
    or the columns containing the count rates from the individual PCUs:

  2. Create GTI files with maketime: If you find, for example, that your observation has periods when all five PCUs are on and periods when only PCUs 0-2 are on, you can generate GTI files containing these periods using maketime:
       kaah[21]% maketime
       Name of FITS file and [ext#][] realtime_go.xfl
       Name of output FITS file[] pcus_01234.gti
       Selection Expression[] NUM_PCU_ON.eq.5
       Column containing HK parameter names[NAME]
       Column containing HK parameter values[VALUE]
       Column containing HK parameter times[TIME] Time
       Flag, yes if HK format is compact[yes] no
       kaah[21]% maketime
       Name of FITS file and [ext#][realtime_go.xfl] 
       Name of output FITS file[pcus_01234.gti] pcus_012.gti
       Selection Expression[NUM_PCU_ON.eq.5] NUM_PCU_ON.eq.3
       Column containing HK parameter names[NAME]
       Column containing HK parameter values[VALUE]
       Column containing HK parameter times[Time] 
       Flag, yes if HK format is compact[no]

  3. Create column selection files: If extracting Standard-2 data then you should create column selection files corresponding to the PCUs and anodes you want. See the recipe Selecting PCA Data by PCU, Layer and Anode for more details. [Note, however, that this is not strictly necessary if you use GTI files to identify the 3-PCU and 5-PCU periods. This is because saextrct does not accumulate exposure from columns with no data in them.]

  4. Extract the source and background spectra and light curves, make the response matrices: The recipe Reduction and Analysis of PCA Spectra explains how. Each 3-PCU, 4-PCU and 5-PCU spectrum and light curve should have a corresponding background file. And you should make responses for 3-PCU, 4-PCU and 5-PCUs.

Combining the Spectra

In this example, we'll combine the following two sets:

                      3-PCU                 5-PCU

       SOURCE   quiescence_012.pha     quiescence_01234.pha
   BACKGROUND   back_012.pha           back_01234.pha
     RESPONSE   p012_L1R1_970218.rsp   pca_L1R1_970218.rsp

  1. Change the headers of the source files: The ftool addspec will combine spectra, but first we should write the names of the background and response files into headers of the source files. Several different ftools can be used to this. With grppha:
       kaah[66]% grppha quiescence_012.pha
       Please enter output filename[] !quiescence_012.pha
       GRPPHA[] chkey BACKFILE back_012.pha
       GRPPHA[] chkey RESPFILE p012_L1R1_970218.rsp
      GRPPHA[] exit
    The exclamation mark before the output filename causes the program to overwrite the input file, which is what we want.

  2. Run addspec to combine the spectra:

    1. First create an ASCII file listing the source PHA files you want to add. In our example, combine_pha.list contains:

    2. Run addspec:
         kaah[73]% addspec
         ** ADDSPEC 1.1.1
         ***** THIS IS A BETA_TEST VERSION (check your o/p) *****
         Input ASCII filename[] combine_pha.list
         Root of Output filename(s)[] quiescence_combo
         Combine any corresponding RMF datasets ?[no] yes
         Create background file (if possible) ?[no] yes
      Here, addspec:

      • created the source PHA file quiescence_combo.pha by combining quiescence_012.pha and quiescence_01234.pha;

      • created the combined background PHA file quiescence_combo.bak by combining back_012.pha and back_01234.pha;

      • created the combined response file quiescence_combo.rsp by combining p012_L1R1_970218.rsp and pca_L1R1_970218.rsp; and

      • wrote quiescence_combo.bak and quiescence_combo.rsp into the header of quiescence_combo.pha.

  3. Combine the response matrices: Since addspec weights responses by exposure rather than by counts, we'll have to regenerate quiescence_combo.rsp with addrmf:

    1. Delete the incorrectly weighted quiescence_combo.rsp. [In case you're wondering, there are two reasons why we created it in the first place. First, addspec wrote its name into the header of quiescence_combo.pha, so if we choose the same name for the correct version, xspec will find it automatically. Second, due to a bug, addspec only assigns certain keywords when a response is generated.]

    2. Determine the weights. To get the total counts in each PHA file, run the ftool fstatistic on the COUNTS column, for example:
         kaah[55]% fstatistic quiescence_012.pha COUNTS
         Range of rows to include[-]
          The sum of the selected column is    1906007.0
      In our example, we have:
         quiescence_012.pha       1906007.0
         quiescence_01234.pha     4100638.0
         back_012.pha               15664.278
         back_01234.pha             33093.738
      which yields the weights 0.3173 for the 3-PCU response and 0.6827 for the 5-PCU response. [Note that the background spectra have non-integer total counts because they were extracted from model data generated by pcabackest.]

    3. Create an ASCII file, combine_rsp.list, say, containing the responses and weights:
         p012_L1R1_970218.rsp  0.3173
         pca_L1R1_970218.rsp   0.6827

    4. Run addrmf to combine the matrices:
      kaah[75]% addrmf
      ADDRMF vers 1.10  10 April, 1997.
      Name of ascii file listing input RMFs or input RMF filenames
      [@rsp.txt] @combine_rsp.list
      Summing ...
      3.173E-01 * p012_L1R1_970218.rsp
      6.827E-01 * pca_L1R1_970218.rsp
      Name of output RMF file[pca_L1R1_970218.rsp] 
      RMF #    1 : p012_L1R1_970218.rsp       0.32
                   XTE        PCA        PCU0       NONE       PHA
      RMF #    2 : pca_L1R1_970218.rsp        0.68
                   XTE        PCA        PCU0       NONE       PHA
  4. Test your results: If the combination worked correctly, then you should find that when you fit the same model in xspec to the combined spectrum, i.e. with:
       XSPEC> data quiescent_combo.pha
    you should obtain a similar fit with the individual spectra:
       XSPEC> data quiescent_012.pha quiescent_01234.pha

Combining the light curves

Suppose you now have two light curves from your observation, one with three PCU on (quiescent_012.lc) and one with all five on (quiescent_01234.lc) and two background files (back_012.lc and back_01234.lc) from which you now want to create one background subtracted light curve. For a naive, first order approximation, it is simply a matter of weighting the light curves by the approximate effective areas of the PCU which are on (noting that each is not exactly the same.)

  1. First, use lcmath to subtract the respective estimated background light curves from the data. Call the results somthing like net_012.lc and net_01234.lc.

  2. Here are the approximate fractions for each PCU of the total 5 PCU effective area; these are simply determined from comparing the individual count rates during Crab observations:

      PCU 0 -- 0.204
      PCU 1 -- 0.204
      PCU 2 -- 0.206
      PCU 3 -- 0.194
      PCU 4 -- 0.191

    So, to determine the weight for your particular combination of PCU, take the inverse of the sum of the corresponding fractions. For our example, to compare the 3 PCU light curve to the 5 PCU light curve, we multiply the former by a factor of 1.63. This is simple to do in lcmath:

    	% lcmath
    	Name of input FITS file[]net_012.lc
    	Name of background FITS file[]net_01234.lc
    	Name of output FITS file[]net_combo.lc
    	Scaling factor for input[1.]1.63
    	Scaling factor for background[1.]
    	Add instead of subract?[no]yes
    where saying yes to the last question was a late addition to the tool to allow light curves to be added. This essentially performs the operation 1.62*net_012.lc+net_01234.lc. The result will be a light curve covering the entire time range as though 5 PCU were on the whole time. (Note that this in no way adjusts the error bars.)

    If you have a question about RXTE, please send email to one of our
    help desks.

    This page is maintained by the RXTE GOF and was last modified on Thursday, 16-Sep-1999 08:38:13 EDT.