How to determine BAT's Spectral Signal-to-Noise Ratio for a particular GRB

28 September 2004

D. Hullinger

Sometimes it is nice to check and see whether a burst detected at some time in the past by some other instrument (like BATSE or HETE) would have produced a counts spectrum with a good signal-to-noise ratio if it had been detected by BAT. Here is a simple way to find out using XSPEC.

See How to Use XSPEC for Simple Tasks for instructions on setting up XSPEC.

Preparation

You will need three things to find the spectral SNR of BAT for a particular GRB

Step 1. Specify the Model

In the example given here, I use the xspec spectral model reported for GRB 040924 at http://space.mit.edu/HETE/Bursts/GRB040924/, which is "cutoffpl".

XSPEC> model cutoffpl
  Model:  cutoffpl<1>
Input parameter value, delta, min, bot, top, and max values for ...
                   1      0.01        -3        -2         9        10
1:cutoffpl:PhoIndex>1.171
                  15      0.01      0.01         1        50       200
2:cutoffpl:HighECut>62.49
                   1      0.01         0         0     1E+24     1E+24
3:cutoffpl:norm>62.66

My inputs are printed in boldface.

Step 2. Make a Fake Spectrum

XSPEC> fakeit none
For fake data, file #   1 needs response file: response.rsp
              ... and ancillary response file: 
Use randomization in creating fake data? (y) n
Input optional fake file prefix (max 4 chars): temp
 Fake data filename (tempresponse.fak) [/ to use default]: /
 Exposure time, correction norm  (1, 1): 150000

The last command specifies the exposure time. In the example we are using, the exposure time is actually 1.5 s, not 150000 s. However, xspec cannot produce fractional counts for its fake data, and BAT's mask-weighted counts can often be fractional. To avoid this problem, I multiplied the exposure time by 100000. Then, when I interpret the fake data, I will divide the counts by 100000.

 Net count rate (cts/s) for file   1   5.679    +/-  6.1532E-03
   using response (RMF) file...       response.rsp
 Chi-Squared =     3.9088514E-02 using    80 PHA bins.
 Reduced chi-squared =     5.0764304E-04 for     77 degrees of freedom
 Null hypothesis probability =  1.00

Step 3. Find the Signal-to-Noise Ratio (SNR)

At this point, you will want to exit from XSPEC:

XSPEC>exit
Do you really want to exit? (y)y
 XSPEC: quit

and run IDL and use it to add up the counts

IDL> a=mrdfits("tempresponse.fak",1)
IDL> e=mrdfits("sample.pha",2)
IDL> print,total((a.counts)[3:78])/100000
      6.98308

I added up bins 3 through 78, which correspond to energies from 14 keV through 194.9 keV.

So this means that if BAT had detected this burst on-axis (and if all of the detectors were enabled), it would have detected 6.98 counts (mask-weighted counts, that is).

Next we must determine the signal-to-noise ratio. This is given by (see Mask-Weight Counts Errors):


where σN is the 1-sigma error bar associated with N mask-weighted counts, k = 0.000112674, and x is the ratio of background counts to N.

If we assume a fairly high background (x=10), then the SNR for the entire energy range considered here comes out to be:

IDL> print,sqrt(total((a.counts)[3:78])/(100000*0.000112674*21))
      54.3253

We can also find the SNR for each energy bin.

IDL> snr=sqrt((a.counts)/(100000*0.000112674*21))
IDL> e_min=e.e_min
IDL> e_max=e.e_max
IDL> all=transpose([[e_min],[e_max],[snr]])
IDL> print,all
      0.00000      10.0000      13.7690
      10.0000      12.0000      14.2822
      12.0000      14.0000      15.9593
      14.0000      16.0000      16.0748
      16.0000      18.0000      15.6993
      18.0000      20.0000      15.1241
      20.0000      22.0000      14.4560
      22.0000      24.0000      13.7455
      24.0000      26.0000      12.5864
      26.0000      28.0000      11.4598
      28.0000      30.1000      10.8953
      30.1000      32.1000      10.2406
      32.1000      34.2000      9.81475
      34.2000      36.3000      9.40959
      36.3000      38.3000      8.85064
      38.3000      40.4000      8.90467
      40.4000      42.5000      8.84873
      42.5000      44.6000      8.47873
      44.6000      46.8000      8.59826
      46.8000      48.9000      7.92266
      48.9000      51.1000      7.80388
      51.1000      53.2000      7.41225
      53.2000      55.4000      7.36678
      55.4000      57.6000      7.08397
      57.6000      59.8000      6.78597
      59.8000      62.0000      6.50650
      62.0000      64.2000      6.19540
      64.2000      66.4000      5.77014
      66.4000      68.7000      5.62325
      68.7000      70.9000      5.25695
      70.9000      73.2000      5.03815
      73.2000      75.4000      4.65172
      75.4000      77.7000      4.49602
      77.7000      80.0000      4.23163
      80.0000      82.3000      3.98367
      82.3000      84.6000      3.79013
      84.6000      87.0000      3.64808
      87.0000      89.3000      3.45654
      89.3000      91.7000      3.26541
      91.7000      94.0000      2.99610
      94.0000      96.4000      2.95204
      96.4000      98.8000      2.81050
      98.8000      101.200      2.58163
      101.200      103.600      2.42287
      103.600      106.000      2.29936
      106.000      108.400      2.19209
      108.400      110.900      2.15711
      110.900      113.300      1.92082
      113.300      115.800      1.83415
      115.800      118.200      1.68900
      118.200      120.700      1.63561
      120.700      123.200      1.54116
      123.200      125.700      1.45075
      125.700      128.300      1.39430
      128.300      130.800      1.28384
      130.800      133.300      1.21274
      133.300      135.900      1.17018
      135.900      138.400      1.07610
      138.400      141.000      1.03608
      141.000      143.600     0.970803
      143.600      146.200     0.907812
      146.200      148.800     0.829989
      148.800      151.400     0.790878
      151.400      154.100     0.771948
      154.100      156.700     0.712146
      156.700      159.400     0.691063
      159.400      162.000     0.640272
      162.000      164.700     0.609846
      164.700      167.400     0.551626
      167.400      170.100     0.524125
      170.100      172.800     0.507742
      172.800      175.500     0.482125
      175.500      178.200     0.450401
      178.200      181.000     0.416266
      181.000      183.700     0.384603
      183.700      186.500     0.384603
      186.500      189.300     0.361959
      189.300      192.100     0.325049
      192.100      194.900     0.290732
      194.900      6553.60     0.903144

The SNR is high for the low-energy bins (16 in the 14-16 keV bin), decreasing to about 3 in the 91.7-94 keV bin, and about 1 in the 138.4-141 keV bin. All in all, the BAT spectrum for this particular burst would have a good SNR, and the peak in the spectral model at 62.49 keV should be easy to detect.