02.02.2014 Views

SPEX User's Manual - SRON

SPEX User's Manual - SRON

SPEX User's Manual - SRON

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.27 Step: Grid search for spectral fits 41<br />

Examples<br />

simulate - This simulates a new spectrum/dataset with Poissonian noise and background subtraction<br />

with the same exposure time and background as the original data set.<br />

simulate noise f - As above, but without Poissonian noise. The nominal error bars are still plotted.<br />

simulate back f - As first example, but now no background is subtracted.<br />

simulate time 10000 1. - Simulate for 10 4 s exposure time and the same background as the template<br />

spectrum.<br />

simulate time 10000 0.2 - Simulate for 10 4 s exposure time but with a 5 times more accurate subtracted<br />

background (the background errors are 5 times smaller).<br />

simulate syserr 0.1 0.2 - As before but with a systematic error of 10 % of the source spectrum and<br />

20 % of the subtracted background spectrum added in quadrature.<br />

simulate instrument 2:4 region 3 time 5000 1 syserr 0.05 0.01 noise f back f - Simulate a<br />

spectrum for region 3 of instruments 2–4, with 5000 s exposure time t, the nominal background error<br />

scaleng f b = 1, a systematic error of 5 % of the source and 1 % of the background, no Poissonian noise<br />

and no background subtraction.<br />

2.27 Step: Grid search for spectral fits<br />

Overview<br />

A grid search can be performed of χ 2 versus 1, 2, 3 or 4 parameters. The minimum, maximum and<br />

number of steps for each parameter may be adjusted. Steps may be linear or logarithmic. For each set of<br />

parameters, a spectral fit is made, using the last spectral fit executed before this command as the starting<br />

point. For each step, the parameters and χ 2 are displayed. This option is useful in case of doubt about<br />

the position of the best fit in the parameter space, or in cases where the usual error search is complicated.<br />

Further it can be useful incases of complicated correlations between parameters.<br />

Warning: Take care to do a spectral fit first!<br />

Warning: Beware of the cpu-time if you have a fine grid or many dimensions!<br />

Syntax<br />

The following syntax rules apply:<br />

step dimension #i - Define the number of axes for the search (between 1–4).<br />

step axis #i1 parameter [[#i2] #i3] #a range #r1 #r2 n #i4 - Set for axis #i1, optional sector #i2,<br />

optional component #i3 and parameter with name #a the range to the number specified by #r1 and<br />

#r2, with a number of steps n given by #i4. If n > 0, a linear mesh between #r1 and #r2 will be taken,<br />

for n < 0, a logarithmic grid will be taken.<br />

step - Do the step search. Take care to do first the ”step dimension” command, followed by as many<br />

”step axis” commands as you entered the number of dimensions.<br />

Examples<br />

Below we give a worked out example for a CIE model where we took as free parameters the normalization<br />

”norm”, temperature ”t”, Si abundance ”14” and Fe abundance ”26”. To do a 3-dimensional grid search<br />

on the temperature (logarithmic between 0.1 and 10 keV with 21 steps), Fe abundace (linear between 0.0<br />

and 1.0 with 11 steps) and Si abundance (linear between 0.0 and 2.0 with 5 steps, i.e. values 0.0, 0.4,<br />

0.8, 1.2, 1.6 and 2.0) the following commands should be issued:<br />

fit - Do not forget to do first a fit<br />

step dimension 3 - We will do a three-dimensional grid search<br />

step axis 1 parameter 1 1 t range 0.1 10.0 n -21 - The logarithmic grid for the first axis, temperature;<br />

note the − before the 21!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!