You are on page 1of 3

Xspec

BY SANJIT DEBNATH

Xspec is a commonly use x-ray spectral-fitting program designed to be


completely detector-independent so that it can be used for any spectrometer.
XSPEC has been used to analyse data from HEAO-1 A2, Ein-stein Observatory,
Chandra, XMM-Newton, Integral, Fermi, Swift, NuSTAR etc.

Spectral Fitting and XSPEC :

Xspec use a spectrometer to measure the spectrum of a source but what the
spectrometer obtains is not the actual spectrum, but rather photon counts (C)
within specific instrument channels, (I). This observed spectrum is related to
the actual spectrum of the source (f(E)) by:

Where R(I,E) is the instrumental response and is proportional to the


probability that an incoming photon of energy E will be detected in channel I.
So then actual spectrum of a source f(E) is deriving by inverting the equation
for a set of C(I). But unfortunately this type of inversion is non-unique and
unstable for a small changes in C(I).

Alternatively f(E), that can be described in terms of a few parameters


(i.e., f(E; p1; p2;…..)), and match, or fit it to the data obtained by the
spectrometer. For each f(E), a predicted count spectrum (Cp(I)) is calculated
and compared to the observed data (C(I)). Then a fit statistic (chi-square) is
computed from the comparison and used to judge whether the model
spectrum fit the data obtained by the spectrometer. Best fit spectrum is
written as fb(E) which have their best fit parameters. Fit statistic is chi square
given as:

Chi-square statistic gives us how good the fit is. Actually we find the reduced
chi-square value and if it come near to 1 fit is said to be good. It value much
greater than 1 indicate poor fit, and much less than 1 indicates error in the
data is over-estimated. Sometime we may have different set of parameters
(different model) with same chi-square value. In such case choice of the
correct model to fit is matter of scientific judgement.

The main component of spectral fitting is as follows:

1. A set of one or more observed spectra D(I) with background


measurement B(I) where available.
2. The corresponding instrumental responses R(I,E).
3. A set of model spectra M(E).

These components are used in the following manner:

1. Choose a parameterized model which is thought to represent the actual


spectrum of the source.

2. Choose values for the model parameters.

3. Based on the parameter values given, predict the count spectrum that
would be detected by the spectrometer in a given channel for such a model.

4. Compare the predicted spectrum to the spectrum actually obtained by


the instrument.

5. Manipulate the values of the parameters of the model until the best fit
between the theoretical model and the observed data is found.

6. Then calculate the goodness of the fit to determine how well the model
explains the observed data, and calculate the confidence intervals for the
model's parameters.

How xspec perform these task given bellow:

First Xspect to obtain the observed spectra C(I), it uses two files, One is the
data spectrum file contains D(I), anther is the background data file, B(I). Both
are used to find the background subtracted counts. Which is determined by
the formula given below,
tD and tB are
the exposure times in the data and background files; bD(I) and bB(I),
aD aB
(I) and (I) are the background and area scaling values from the spectrum
and background respectively.

To find actual count xspec also has to take the instrumental (detector
response) R(I,E) is proportional to the probability that an incoming photon of
energy E will be detected in channel I. The response is a continuous function of
E. This continuous function is converted to a discrete function by the creator of
a response matrix given by,

XSPEC reads both the energy ranges, EJ and the response matrix RD(I,J).

The model spectrum M(E) is calculated within Xspec using the energy
ranges defined by the response file :

It is in units of photons/cm2/s. XSPEC allows the construction of composite


models consisting of additive components representing X-ray sources (power-
laws, blackbodies and so on). Mixing models can then perform sophisticated
operations on the result. Models are denoted in algebraic notation. This is how
a preferable model is defined.

After data have been read in and a model defined, XSPEC uses a fitting
algorithm to minimize the fit statistic, and hence find the best-fit values of the
model parameters. The default is a modified Levenberg-Marquardt algorithm
(based on CURFIT from Bevington, 1969). The algorithm used is local rather
than global, so be aware that it is possible for the fitting process to get stuck in
a local minimum and not find the global best-fit. The process also goes much
faster (and is more likely to and the true minimum) if the initial model
parameters are set to sensible values.

At the end of a fit, XSPEC will write out the best-fit parameter values, along
with estimated confidence intervals. These confidence intervals are one sigma
and are calculated from the second derivatives of the fit statistic with respect
to the model parameters at the best-fit. These confidence intervals are not
reliable and should be used for indicative purposes only.

You might also like