Imagine the Universe!
Imagine Home  |   Teachers' Corner | HERA Overview  | Using HERA for Spectroscopy  |  

Modeling the Spectrum

You are now ready to start to create a model for the spectrum you just loaded into Xspec. Xspec has several standard models, and in general, it is best to start with the simplest model and build on it as necessary.

In the world of astrophysics, simple phenomena include those that produce a continuous x-ray emission, much like a rainbow, where all colors are represented. You will use a model of Bremsstrahlung emission, which is one mechanism that produces continuous X-ray emission. (Read more on continuous X-ray emission and Bremsstrahlung.)

In the Xspec command window, type:

model wabs * brems

This model has two components:

  • wabs models the effects of absorption. Space is not empty. As light travels across the great distances to reach us, some of it will be absorbed by matter that lies between us and the source. This component of your model accounts for that absorption. It is characterized by the free parameter, nH.
  • brems models the continuous emission due to Bremsstrahlung. This model component has two free parameters. The first is kT, which characterizes the temperature of the X-ray-emitting matter. The second is norm, which is a measure of the intensity of the spectrum.

Xspec will prompt you to enter starting values for each of these parameters, as shown below:


For these parameters, you can just use the default values in Xspec. To do that, hit return when Xspec prompts for the values for nH, kT, and norm. Xspec will fill in the values for these parameters.

Screen capture showing the initial input for 
	the wabs*brems model in the xspec command window

Initial model input. (Click for a larger view.)

Recall that in our simple data fitting example the first guess was not the best model for the data. The same is true here – the first guess is probably not the best fit of the spectrum. Xspec will fit the model to the data attempting to minimize the Chi-squared value discussed alongside the data fitting example.

Have Xspec minimize Chi-squared for the current model and determine the best-fit values for the free parameters by typing:


at the command line interface.

Xspec will go through a set number of trials trying to maximize the fit between the model and the data. When that number of trials is finished, Xspec will pause to let you know that it has not found the best fit yet. Since you want Xspec to find the best fit, hit return each time it gives you the following message:

Number of trials exceeded: continue fitting?

By hitting the return button, you are telling Xspec to continue trying to find the best fit. You will have to hit return a couple of times until Xspec finds the best fit and returns to the Xspec prompt (XSPEC12> )

Screen capture showing the command
	window after the first attempt to fit

After one attempt at fitting the spectra. When asked whether to continue fitting, hit Return. (Click for a larger view.)

When Xspec has finished fitting, you should see a summary of the fit above the prompt. This summary has a table that lists the best-fit values for each of the free parameters in the model. In addition, the summary includes the Chi-squared value for the current fit. These are shown in the screen-shot below.

Screen capture showing the command
	window after the Bremsstrahlung model has been fitted to the

Screen shot of the Xspec command window showing the results of fitting the Bremsstrahlung model. Arrows indicate how to read the results.

(Click for a larger view.)

Imagine the Universe is a service of the High Energy Astrophysics Science Archive Research Center (HEASARC), Dr. Alan Smale (Director), within the Astrophysics Science Division (ASD) at NASA's Goddard Space Flight Center.

The Imagine Team
Acting Project Leader: Dr. Barbara Mattson
All material on this site has been created and updated between 1997-2012.

DVD Table of Contents
Educator's Index