skip to content
XMM-Newton Guest Observer Facility


Fit an RGS Spectrum with Xspec (Locally Installed)

For this example, we will focus on the O VII triplet from in Capella's spectrum. To start, invoke Xspec on the command line:

Enter the data at the prompt, and edit the fitting parameters as needed. Since we generated this spectrum with rgscombine, the header already points to the response file, so Xspec automatically loads it. If we were working with a dataset where the header has not been changed, we'd need to load it with the resp command ('resp my_response_file.fits').
   XSPEC> data r12_o1_srspec.fits              ! input the data 
   XSPEC> ignore **-0.55,0.585-**              ! set some appropriate limits
   XSPEC> abund wilm                           ! set the elemental abundance table
   XSPEC> statistic cstat                      ! set the statistic
   XSPEC> xsect vern                           ! set the photoelectric cross section
   XSPEC> model apec                           ! set the spectral model to thermal plasma
   1:apec:kT> 0.5                              ! enter reasonable initial values
   2:apec:Abundanc> 1
   3:apec:Redshift> 0
   4:apec:norm> 1.0
   XSPEC> renorm                               ! minimize the statistic with the current parameters
   XSPEC> fit
   XSPEC> cpd /xw                              ! open an X window
   XSPEC> setplot wave                         ! plot in wavelength space
   XSPEC> setplot xlog off                     ! set the X axis to linear scale
   XSPEC> plot data resid                      ! plot the fit and residual
   XSPEC> newpar 3 1e-4                        ! set the third parameter (Redshift) to 1e-4
   XSPEC> thaw 3                               ! let the redshift float
   XSPEC> fit
   XSPEC> newpar 2 0.9                         ! set the second parameter (Abundanc) to 0.9
   XSPEC> thaw 2                               ! let the abundances float
   XSPEC> fit
   XSPEC> plot data resid  
   XSPEC> exit
Figure 1 shows the fit to the spectrum.
Figure 1: The O VII triplet in the 1st order RGS1 spectrum fitted with an apec model.

If you have any questions concerning XMM-Newton send e-mail to

This file was last modified on Tuesday, 19-Nov-2013 17:08:40 EST
Curator:Michael Arida (ADNET);

NASA Astrophysics

  • FAQ/Comments/Feedback
  • Education Resources
  • Download Adobe Acrobat
  • A service of the Astrophysics Science Division (ASD) at NASA/ GSFC

    XMM-Newton Project Scientist: Dr. Steve Snowden

    Responsible NASA Official: Phil Newman

    Privacy Policy and Important Notices.