22.04.2014 Views

SPEX Reference manual (PDF) - SRON

SPEX Reference manual (PDF) - SRON

SPEX Reference manual (PDF) - 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.29 System 43<br />

Warning: One should first rebin the data, before running syserr. Run syserr however before fitting the<br />

data or finding errors on the fit.<br />

Warning: Running syserr multiple times will increase the error every time. If the input to syserr is<br />

wrong one should restart <strong>SPEX</strong> and rerun syserr with the correct values to calculate the total error correctly.<br />

Syntax<br />

The following syntax rules apply:<br />

syserr #i: #r1 #r2 - The shortest version of this command. #i: is the range in data channels for<br />

which the systematic error is to be calculated and added (in quadrature) to the Poissonian error. #r1 is<br />

then the the relative systematic error due to the source and #r2 the relative systematic error due to the<br />

background.<br />

syserr [instrument #i1:] [region #i2:] #i3: #r1 #r2 - In this syntax one can also specify the<br />

instrument and the region one wants to calculate the combined error for. Both can be ranges as well.<br />

#i3: has the same role as #i: in the above command, and #r1 and #r2 are the same as above.<br />

syserr [instrument #i1:] [region #i2:] #i3: #r1 #r2 [unit #a] - Exact same command as<br />

above, except that now the data range (#i3:) for which the errors are to be calculated are given in units<br />

different than data channels. These units can be Å (ang), eV (ev), keV (kev), Rydbergs (ryd), Joules (j),<br />

Hertz (hz) and nanometers (nm). This is the most general command.<br />

Examples<br />

syserr 1:100000 0.3 0.5 - Calculates the combined Poissonian and systematic error for data channels<br />

1:100000, where the fraction of the systematic error of the source is 0.3 and the background is 0.5.<br />

syserr 0:2000 0.3 0.5 unit ev - The same as the above command, expect that now the error calculation<br />

is performed between 0 and 2000 eV instead of data channels.<br />

syserr instrument 2 region 1 0:2000 0.3 0.5 unit ev - The same as the above command, but<br />

now the error calculation is only performed for the data set from the second instrument and the first<br />

region thereof.<br />

2.29 System<br />

Overview<br />

Sometimes it can be handy if <strong>SPEX</strong> interacts with the computer system, for example if you run it in<br />

command mode. You might want to check the existence of certain file, or run other programs to produce<br />

output for you, and depending on that output you want to continue <strong>SPEX</strong>.<br />

Therefore there is an option to execute any shell type commands on your machine, using the fortran ”call<br />

system” subroutine.<br />

Another useful goody is the possibility to stop <strong>SPEX</strong> automatically if you find some condition to occur;<br />

this might be useful for example if you have a program running that calls <strong>SPEX</strong>, and depending on the<br />

outcome of <strong>SPEX</strong> you might want to terminate the execution. This is achieved in <strong>SPEX</strong> by testing for<br />

the existence of a file with a given filename; if the file exists, <strong>SPEX</strong> stops immediately execution and<br />

terminates; if the file does not exist, <strong>SPEX</strong> continues normally.<br />

Syntax<br />

The following syntax rules apply:

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

Saved successfully!

Ooh no, something went wrong!