Using SPEX 2.00 to analyse stellar RGS spectra SPEX is a spectral fitting package, designed specifically for high resolution X-ray spectra, written by Jelle Kaastra (SRON). The latest version (2.00) is installed at MSSL on the SUN msslhd. This document demonstrates the use of SPEX to analyse RGS spectra of stars. Further information and help on SPEX 2.00 can be found on http://www.mssl.ucl.ac.uk/~ajb/spex/ including lists of commands and models. RGS spectra are accompanied by a response matrix which parameterises the effective area of the spectrometer across its wavelength range. The SAS generates the spectrum and response in .pha and .rmf formats respectively, and these are converted to SPEX format (.spo and .res) using trafo, which is described in http://www.mssl.ucl.ac.uk/~ajb/spex/1_trafo.txt. In the following discussion we assume that we have the files spectrum.spo and response.res in the working directory on msslhd. Firstly, start SPEX by typing >spex and read in the spectrum and response matrix: SPEX> data response spectrum Note that you leave the .spo and .res off the filenames when you use this command. Now plot the spectrum: set the plot device SPEX> plot device xw set the plot type SPEX> plot type data set the units on the x-axis to angstroms SPEX> p ux a and set the y-axis to counts/second/angstrom SPEX> p uy a and finally use the plot command: SPEX> p Every time something is changed in the plot or model the plot command has to be repeated as the plot is not updated automatically. Next, construct a spectral model. We will use a three-temperature thermal model. In SPEX, a spectral model is assembled by: firstly, defining the various model components; and secondly, defining the relationship of these components to each other. Before a model can be assembled though, since SPEX works using source luminosities rather than fluxes, one must set the distance to the source. To set the source distance to 8.8 parsecs: SPEX> distance 8.8 pc For a three-temperature thermal model, we need to define three cie (collisional ionisation equilibrium) components: SPEX> com cie SPEX> com cie SPEX> com cie Some model components are additive and others are multiplicative. For each additive component, you have to define which components it is multiplied by. In this case, cie is additive and no multiplicative components are required. The model setup can be viewed by typing: SPEX> model show and the values of the model parameters are displayed using: SPEX> par show The cie model allows the user to specify emission measure (i.e. the normalisation), the electron temperature of the plasma, the electron density, ion temperature, microturbulance velocity, sigma (log T) and the relative (to Solar) abundances of all the individual elements from Helium to Zinc. So, for the first cie component, let's set the electron temperature to 0.3 keV, the emission measure (normalisation in 1E64/m**3) to 0.000001 and the electron density to 0.0002 (in 1E20/m**3). SPEX> par 1 1 t value 0.3 SPEX> par 1 1 norm value 0.000001 SPEX> par 1 1 ed value 0.0002 The first number after 'par' refers to the dataset (multiple datasets can be read in by repeating the 'data response spectrum' command) and the second refers to the component number. We'll set the second component to 0.7 keV and the third to 1.126 keV: SPEX> par 1 2 t value 0.7 SPEX> par 1 3 t value 1.126 then couple the electron densities of cie 2 and 3 to the electron density of cie 1: SPEX> par 1 2 ed couple 1 1 ed SPEX> par 1 3 ed couple 1 1 ed and the normalisations and elemental abundances likewise: SPEX> par 1 2 norm couple 1 1 norm SPEX> par 1 3 norm couple 1 1 norm SPEX> par 1 2 02:30 couple 1 1 02:30 SPEX> par 1 3 02:30 couple 1 1 02:30 and couple the electron and ion temperatures for each phase of the plasma: SPEX> par 1 1 it couple 1 1 t SPEX> par 1 2 it couple 1 2 t SPEX> par 1 3 it couple 1 3 t After the model has been set up and some parameters defined, it can be calculated and plotted: SPEX> c SPEX> p The model must be re-calculated every time a change is made, and re-plotted. To zoom in on, say, the O VII triplet region, use: SPEX> p rx 20 24 SPEX> p Now we will fit the normalisation of cie 1 (which is now coupled to the normalisations of the other two components). The t and norm parameters are automatically set to 'thawed', i.e. allowed to vary in the fit, so we need to freeze the temperatures of the three components, as follows: SPEX> par 1 1 t status f SPEX> par 1 2 t status f SPEX> par 1 3 t status f If we wanted to concentrate on the region of the O VII triplet when fitting, the rest of the spectrum could be ignored: SPEX> ignore 1:20.5 unit a SPEX> ignore 23:50 unit a SPEX> p To ensure that the result of each fit iteration is plotted as the fitting algorithm progresses: SPEX> fit print 1 and then finally SPEX> fit to calculate the error on the normalisation, use: SPEX> error 1 1 norm Then you can zoom out to view the whole spectrum again: SPEX> use 6:38 unit a SPEX> p rx 6 38 SPEX> p A postscript plot is produced using the following sequence of commands: SPEX> plot dev cps filename.ps SPEX> p rx 6 38 SPEX> p SPEX> plot close 2 To exit from SPEX, type: SPEX> q