This is an f statistic calculator for generated fake spectra. The .xcm file only serves as an example. User .xcm loaded data will be different. The xcm file consists of tcl script that loops over the fake data and calculates the f statistic using the fake spectra and the original spectra. The number of fake spectra can be adjusted from the .xcm loop.
This sort of a script was employed for calculating the posterior predictive p-value using the fakeit command in xspec
In general, the script can be modified to caculate and other statistic other than the f-statistic. This will be automated eventually.
-
Copy the
calc-f-stat.shand thef-stat.xcmfiles to the location containing the all fake spectra files and the fake background files. The location must also contain the original.fitsspectrum file,.fitsbackground file and the.rmfresponse file. -
Make the
.shfile executable by opening a terminal and entering the following commandchmod u+x calc-f-stat.sh -
Execute using
./calc-f-stat.sh -
An output file named
f_statistic.txtwill be generated which will contain all the f statistic values.