The process of building spectra was discussed in detail in Evans et al. (2009). Since then, there have been many small modifications and many larger under-the-hood improvements in efficiency, which are detailed in the changelog. This page provides an up-to-date overview of the algorithm. This is deliberately written generically, to cover both automatically generated GRB spectra and those created on-demand: the only differences between these two cases are the absorption model used (see Spectral Fitting, below) and the time-intervals of the spectra created, which can be set by hand for the on-demand spectra.
Back to contents | Back to repository
The spectrum creation begins with an attempt to detect and localise the source (unless centroiding has been disabled), initially using only the data from the first observation, but using later datasets if the source cannot be found in the first one. A deep image of all observations is also created, and source detection is used to identify all sources in this image, so that they can be excluded from the background extraction region. From this point onwards, the process is performed independently for PC and WT modes. If multiple spectra were requested (i.e. covering different time intervals) these are also created independently. The basic algorithm, described below, is thus followed for each mode and each spectrum. First, the software identifies which observations lie within the selected time interval, and then splits these into snapshots - periods of continuous observation - and the following steps are run for each snapshot:
1 An event list has a single roll angle keyword (PA_PNT
), so
if there are multiple spacecraft orbits in the list it will contain the mean value. The s.mkf
file in
the data auxil
directory gives the roll angle as a function of time, and we use this to determine
the per-snapshot roll angle.
Once all the snapshots in the observation have been processed in this way, the source event lists
are merged into a single event list, as are the background event lists. The ARF files are also merged
using the addarf
tool. This produces a weighted average ARF, where the individual ARFs are weighted according
to the number of counts in the source event list related to the ARF. Once all observations have been processed, these merged event
lists and ARFs from each observation are merged to give a single source event list, background event list and ARF file.
As before, the ARFs are weighted according the number of events in the per-observation source event lists.
At this stage an RMF is also created, by identifying the RMF in the CALDB appropriate to each per-observation
ARF, and then combining them using the addrmf
tool, weighted according to the source counts.
The final step is to extract source and background spectra from the event lists, using the extractor
tool.
The source spectrum is grouped to have at least one count per bin, using the grppha
tool,
and the data are then fitted in xspec
.
Back to contents | Back to repository
Models are fitted to the spectra using xspec
.
The automated fit uses an absorbed power-law model, where the tbabs
model is used for the absorption
along with the Verner et al. (1996) cross sections
(xsect vern
) and the Wilms et al. (2000)
abundances (abund wilm
). A cflux
component is also used: this fits the flux rather
than the model absorption, and allows the uncertainty in the flux to be calculated easily.
For GRBs, or on-demand objects with a supplied redshift, the absorption model comprises two
components: a tbabs
component with the absorption fixed at the Galactic value
(determined from Willingale et al. 2013)
and a second tbabs
which is free to vary. If the redshift of the obect is known, this will be a ztbabs
with the redshift frozen at the appropriate value. For on-demand spectra where the redshift is not supplied, only a single
tbabs
component is used, and it is free to vary.
The fit is performed using the W-statistic within xspec
, this is selected
via the statistic cstat
command in xspec, but since Swift data have Poissonian backgrounds and
we supply a background spectrum, xspec
automatically selects the W-statistic:
see the Xspec
user manual, Appendix B for more details.
Once the fit is complete, the 90% confidence errors are calculated using the error
command
in xspec
which steps each parameter in turn, to identify the range of values it can occupy
without increasing the fit statistic by more than 2.706.
For GRBs, an absorbed power-law model is expected to be a good fit, but for other objects, or the spectrum is evolving2, it may not be. Therefore we provide a link allowing you to download a tar file containing all of the data files for the spectrum so that you can fit it yourself if you wish.
2 If the source evolves spectrally during the interval over which the spectrum is compiled, the non-evolving model may give a poor fit, with residuals that hint at, for example, a thermal component in the spectrum. However, this is simply an artefact of fitting an evolving spectrum with a non-evolving model. If spectral evolution is present, we strongly advise creating spectra over time intervals small enough that the evolution is not significant.