Let's assume there are source spectral files which you want to combine,
and these files have the EXPOSURE values
and BACKSCAL values
respectively. These spectral files should have the unit COUNTS (not COUNTS/sec), as expected being produced with standard HEASARC software packages.
Corresponding background files are
which have the EXPOSURE values
and BACKSCAL values
respectively.
For each pair of the source and background spectral files, XSPEC calculates the following quantities (background subtracted spectra) to be fitted with models.
From these quantities, one can make a single quantity,
This is the quantity we should make to be fitted with models.
With mathpha, can be summed with the option ``exposure=CALC" and ``backscal=NONE" (or ``backscal=1"), so that the combined spectrum has the EXPOSURE value and the BACKSCAL value unity.
Let's put the weights for the background spectra to combine with and the BACKSCAL value for the combined background spectrum . With the option ``exposure=CALC", the EXPOSURE of the combined background spectrum will be
By properly choosing , as shown below, this can be made equal to the desirable EXPOSURE value,
So we have,
Consequently if the combined background spectrum thus made is subtracted from the combined source spectrum, XSPEC calculates the quantity,
The values (1) and (3) should agree. Hence we have,
Equation (2) and equations (4) can be solved for and . Then finally, we get,
These are the values you need to ensure the correct amount of background subtraction.