The FIT_SPECTRA stage of AE (§7.11) can automate spectral fitting by running the XSPEC package (Arnaud, 1996) on each source's extraction data products. The XSPEC command interface is mediated through the Tcl scripting language, providing powerful programming features such as string manipulations, looping, conditions, and ASCII file I/O. An XSPEC script following certain interface requirements described in §7.11 must be supplied to AE.
Several such scripts, implementing simple spectral models, are distributed in the AE package. These carefully crafted scripts (originally developed by Konstantin Getman) fit the observed spectrum, estimate 90% confidence intervals on the fit parameters, calculate fluxes and estimate 90% flux confidence intervals over several energy bands, and produce various text and PostScript output. Both of XSPECs fit statistics, and the C-statistic, are supported. The MODEL_CHANGES_FILENAME mechanism described in §7.11 can be used to override some script parameters without editing the script. If you choose to build your own XSPEC script that is compatible with AE, please consider providing it back to the AE community for use by your colleagues.
The following scripts are distributed with AE:
Spectral fitting of weak sources remains a poorly understood task among the community of X-ray observers. If is to be used there seems to be little consensus on the best trade off between group size and the number of groups. For both and C-statistic methods there seems to be little consensus on the conditions necessary for the parameter error estimates produced by the delta-fit-statistic methods in XSPEC to be appropriate/reliable.
Several observers using this Cstat-with-background capability have noted that seemingly undesirable fits are fairly common. For thermal models, typically the plasma temperature will be obviously too low, leading to very poor fits at high energies. (Examples of this problem will be shown later.)
We believe that these problems are the result of the under-constrained nature of the background model used by Wachter et al. (1979). That model represents the incident background flux in each spectral bin with an independent parameter, with no constraints. Thus, in an ungrouped ACIS spectrum with 500 channels the Wachter background model contains 500 free parameters. (The best-fit background parameter values are computed by algebraic manipulation (Wachter et al., 1979) and are thus hidden from XSPECs Cstat minimization search.)
In our view, such an extremely flexible model of the ACIS background is inappropriate. For many of our ACIS sources, both the extracted source spectrum and the background spectrum have relatively few counts (far fewer than the 500 parameters in the Wachter background model); in any single channel both spectra will typically have only zero or one observed count. As it tries to follow the data, this flexible background model should be driven to zero (an unphysical result) in all channels that have no source or background events. One can imagine the more troubling tendency of the background model to try to ``follow'' the source counts, i.e. to spike upward at each channel where there is a source count. This could allow the background model to siphon off flux that should be represented in the source model. More generally, one should expect that this flexible background would be very sensitive to the random (physically meaningless) alignment of the source and background counts, e.g. whether a source and background count of similar energy happened to fall in the same channel or in adjacent channels.
Motivated by these concerns, we decided to implement a smoother (more constrained) physics-free model for ACIS background spectra to replace the Wachter background model when the C-statistic is in use. We arbitrarily chose a model family consisting of continuous piecewise-linear functions with 2 to 10 vertexes; an example of such a model is shown in Figure 5. The model has 2 to 10 parameters representing the X-ray fluxes at the vertices's. The vertices's are placed on the energy scale so that they divide the energy range into intervals with approximately equal numbers of observed counts in the background spectrum (0.1 to 10 keV). Vertex energies are chosen to coincide with the energies of actual events in the background--this helps to prevent the vertex flux from being driven to the hard limit of zero during the fitting process. We use the name cplinear to refer to this model. Obviously, this smooth model would not be appropriate for very high quality background spectra that have significant of structure.
The AE fitting scripts configure XSPEC as shown in Figure 6. The background spectrum is compared (via the C-statistic) to a cplinear model passed through a flat ARF, rather than through the Chandra ARF. Thus we are in effect modeling the observed ACIS background, not any sort of incident astrophysical background. The source spectrum is compared (via the C-statistic) to the sum of two models:
We have found that the cplinear model produces far fewer fits that are obviously poor. In Figure 7, below each example of a poor fit produced by the Wachter background method (rows 1 and 3) is shown an arguably better fit to the same source produced by the cplinear method (rows 2 and 4). Appendix B compares the Wachter and cplinear models applied to real ACIS spectra.