 
  
  
   
We do not yet have a script to create simulations. The following recipe works:
#! /bin/tcsh -f echo "mo ray" echo "0.4 1.0000E-02 8.0000E-03 8.0000E-03 64.00 64.00" echo "1.0 -1.0000E-03 0. 0. 5.000 5.000" echo "0. -1.0000E-03 0. 0. 2.000 2.000" echo "1e-3 1.0000E-02 0. 0. 1.0000E+24 1.0000E+24" set comlist = `cat $1` foreach file ($comlist) echo "fakeit none" echo "new_resp.fits" echo " hri_arf.fits" echo "y" echo "\n" echo $file echo "6688, 1.0000 , 1.0000 , 0." end
The script will output the model parameters, ie. the first 5 lines of the script. The script will then read in a list of file names and output a set of instructions to xspec to create multiple fake pha files. If the list of file names is as follows:
pha1 pha2the output of the script will be:
mo ray 0.4 1.0000E-02 8.0000E-03 8.0000E-03 64.00 64.00 1.0 -1.0000E-03 0. 0. 5.000 5.000 0. -1.0000E-03 0. 0. 2.000 2.000 1e-3 1.0000E-02 0. 0. 1.0000E+24 1.0000E+24 fakeit none new_resp.fits hri_arf.fits y \n pha1 6688, 1.0000 , 1.0000 , 0. fakeit none new_resp.fits hri_arf.fits y \n pha2 6688, 1.0000 , 1.0000 , 0.
> xspec xinputThe result will be 2 fake pha files, pha1.pha and pha2.pha. A larger number will be needed to obtain a statistically meaningful result!
procedure ratio (scanfile,output)
char *list
char scanfile {prompt ="Enter simulation list"}  #image list
char output {prompt="Output file"}
begin
#declare local variables
char spect,outfile
real h,r,e,s
list=scanfile
outfile=output
#read file
while (fscan (list,spect) !=EOF){
fstatistic(infile=spect,colname="counts",rows="1-4")
s=fstatistic.sum
fstatistic(infile=spect,colname="counts",rows="5-15")
r=s/h
e=r*(s**(-1)+h**(-1))**(0.5)
print(h,s,r,e, >> outfile)
}
end
The parameters for this script are a file containing a list of fake pha files and the name of the output file. The output file is an ascii file with columns containing the number of ``hard'' counts (channels 5-15 in this case), the number of ``soft'' counts (channels 1-4), the ratio soft/hard and the ratio error.