(^{*}*Note:* XSPEC v11.1.0o has one known bug when implementing
its pileup model. The syntax: pileup*model1*(model2+...) will result
in the pileup model parameters not varying during fits; however, the syntax
pileup*(model1*(model2+...)) will implement correctly, and it is this syntax
that we have used throughout. Later versions of XSPEC have corrected this
syntax bug.)

*Note Added April 11, 2002:* A new version of XSPEC, v11.1.0ad,
is now available that purports to correct the problems discussed below.
I have yet to test this version, but will report the results here once
I do.

All data presented here represent low temperature (~0.2 keV), low flux
(~0.1 counts per second) blackbodies absorbed by a neutral column (~10^{21}
cm^{-2}). For these particular spectra, the pileup fraction
is low: most piled up events represent the sum of two, occasionally three,
photons, and the total fraction of events that represent piled events is
typically < 10%.

Discussions of heavily piled up spectra can be found in Davis (2001).

- Cross check the results of the three fitting packages with one another, to ensure that they are implementing the pileup correction model of Davis (2001) in a consistent manner.
- Cross check the output results with known (simulated) input results, in order to determine how successfully the input spectrum can be recovered.
- Provide a calibration for the "grade migration" alpha parameter of the Davis (2001) model (although see the caveats below regarding `calibration' of alpha).

In reality, the alpha parameter should be a photon energy-dependent and detector chip-dependent matrix. For simplicity, the model of Davis (2001) assumes a constant value. The real data presented here are for the ACIS-I chips, and furthermore, the spectrum is such that most of the piled events represent two or three approximately 1 keV photons being piled into either a bad event, or an event detected as a 2-3 keV photon. Thus, the fitted values of alpha cannot be interpretted as necessarily being applicable to other chips, or to spectra with very different spectral energy distributions. In general, it is strongly recommended that, lacking specific calibration information, alpha be left as a free parameter in any fits.

If we first assume no pileup correction, fits with ISIS and XSPEC produce
essentially identical results. Specifically, the chi^{2}
is 197 for 113 degrees of freedom. The fitted neutral columns are
slightly too low (n_{H} = 0.17 X 10^{22} cm^{-2}),
and the fitted temperatures are slightly too high (kT = 0.225 keV). As
shown in the figure for the XSPEC fit, an excess is clearly seen at photon
energies of > 2 keV. This excess is due to piled events.

*Letting the alpha parameter be freely fit, ISIS successfully recovers
the input parameters.* Specifically, the ISIS fits find:
n_{H} = 0.216 +/- 0.019 X 10^{22} cm^{-2}, kT =
0.205 +/- 0.005 keV, norm=3.7 +/- 0.3 X 10^{-6}, alpha = 0.42 +/-
0.9 (90% confidence levels). chi^{2} is 131 for 112 degrees
of freedom. The best fit is shown below.

Fits with XSPEC, on the other hand, while reproducing the neutral column
and blackbody parameters, produce an alpha greater than both the ISIS fits
and the input value. Specifically, nH = 0.241 +/- 0.010 X 10^{22}
cm-2, kT = 0.193 +/- 0.004 keV, norm=4.2 +/- 0.3 X 10^{-6}, alpha
= 0.95 + 0.05 /- 0.23 (90% confidence levels). chi^{2} is 124 for
112 degrees of freedom. As shown in the figure on the left below, XSPEC
does produce a good fit to the data and removes the excess at > 2 keV;
however, XSPEC required an alpha significantly larger than the input
value and the best fit ISIS value in order to achieve these results. Applying
the best fit XSPEC parameters to the ISIS model produces a statistically
significant excess above the data, as shown in the figure on the right.

This discrepancy between ISIS and XSPEC fits can be further explored
by performing fits for fixed alpha, and then varying alpha between 0 and
1. (To automatically tabulate these fits, the following S-Lang script
was written for ISIS, while a TCL
script was written for XSPEC.) The results are presented in the figure
below, which shows chi^{2} relative to the (overall, i.e. ISIS
and XSPEC) minimum value, vs. the pileup alpha parameter. Triangles
are for ISIS fits, while diamonds are for XSPEC fits. Lines represent
delta chi^{2} = 2.71 (i.e., the 90% confidence interval) from the
minima of the ISIS and XSPEC chi^{2} values. As expected,
the chi^{2} of the fits agree for no-pileup correction, but the
results become increasingly discrepant for larger values of alpha.
For the ISIS fits, the minimum in chi^{2 }near the input value
is clearly seen, and the trend for XSPEC to fit larger values of alpha
is also clearly seen.

The same trends also appear in real data taken with the ACIS-I chips
in imaging mode. Below we show the chi^{2} relative to the
minimum values vs. alpha for two separate spectra. These spectra
represent two observed sources, believed to be well described by absorbed
blackbody models. (Here, however, we have also allowed for the possiblity
of a power law tail with a photon index fixed to a value of Gamma = 2).
Again, ISIS and XSPEC yield the same fit results and agree that the data
are poorly fit *if no pileup correction is applied*. Applying
pileup correction and letting alpha be freely fit, the ISIS fits strongly
prefer a value of alpha ~ 0.5, while the XSPEC fits prefer alpha ~ 1.0.
Comparing the best fit ISIS and XSPEC models for each data set, it is found
that the ISIS and XSPEC fitted values of temperature disagree by ~10%,
the (low, < 10^{21} cm^{-2}) fitted values of the neutral
column disagree by a factor of two, and ISIS places more stringent upper
limits than XSPEC on the flux in any power law component.

Updates to XSPEC are frequently posted on the XSPEC webpages, and any changes to the implementation of the XSPEC pileup model will be posted there first. If new implementations (i.e., beyond the v11.1.0o model discussed above) of the XSPEC pileup model become avaialble, further comparisons will be posted here.

*Note Added April 11, 2002:* A new version of XSPEC, v11.1.0ad,
is now available that purports to correct the problems discussed below.
I have yet to test this version, but will report the results here once
I do.

In practice, one can effectively ignore^{**} energy channels
in Sherpa by assigning extremely large error bars (i.e., very low
statistical weight) to the undesired channels. However, this does
have the unfortunate side effect that one then must use a fit statistic
that is based directly upon the data error bars (e.g., the Cash statistic
could not be used). One could instead effectively ignore the
channels via the Sherpa "read weights" function. To do this,
specify an ascii file of the same length as the unfiltered input
PHA data as:

`1 0
# effectively ignore channel`
`2 0`
`3 1
# include channel`
`...`
`1024 0`

then read this file in:

`sherpa> read weights <filename>`

(^{**} In general, when *not applying *pileup correction,
one
*can* ignore energy channels in Sherpa; however, as currently
implemented, the Sherpa pileup correction module does not allow energy
channels to be ignored.)

Within ISIS, however, any data bin can be ignored for pileup fits in the usual manner (e.g., "xnotice(1,1.,10.)").

When fit in similar manners (i.e., noticing all channels), ISIS and
Sherpa, however, do give identical results.