How to use XSPEC with the BATSE Trigger Data

This document describes the software and database files required to perform time and/or energy cuts on BATSE trigger data (i.e. GRBs or solar flares), and then perform detailed forward-folding spectral analysis using the XSPEC package.The required utilites,  fbbft2pha, fbdrm2rmf, and bcmppha  are all part of the the GSFC "FTOOLS"  repository.

(1)Obtain BFITS & DRM files

For instance, obtain

her_bfits_1_143.fits
her_drm_1_143.fits

from ftp://legacy.gsfc.nasa.gov/compton/data/batse/trigger/00001_00200/00143_burst/.

(2)Make a type II PHA file from a BFITS file using FTOOLS:fbbft2pha

Type: fbbft2pha her_bfits_1_143.fits her_bfits_1_143.pha

(3)FTOOLS:bcmppha

You need to make a source file and a background file using bcmppha. Place her_bfits_1_143.pha
under directory called "data_dir". Then type:bcmppha.

>Please enter data directory[ ] data_dir
>Please enter typeII PHA filename[ ]her_bfits_1_143.pha
>Please enter output filename[ ] her_s_1_143.pha  (or her_b_1_143.pha)
>Please enter file mode Background or Source[ ]s (or b)
>List Time History? yes or no[no]
> Main BCMPPHA Ver 1.0.0
>Please enter Start Channel[1]
>Please enter Stop Channel (1:128) [128]
>Plot Time History? yes or no[yes]

The following menu pops up.
Initial Window of bcmppha
 
Click the green dot "Plot". Then the light curve pops up.

Light Curve

(4)Make a source PHA file using FTOOLS:bcmppha

select s (source) above at

>Please enter file mode Background or Source[ ]s

Consider spectra number 7-19 as "source". bcmppha asks

> Click left mouse button to get the position

click left mouse button at "7"
 

> Click right mouse button to fix the position and exits cursor
> Chose spectra number: s1

then click right mouse button to determine the begining point as
source (s1). The dotted line appears as follows.

Beginning of source
> spec_num =  7 spec =    6804.68
> Chose spectra number: s2

Move cursor to "19" and click left mouse button then click right mouse button to determine the ending point as a source (s2).

>spec_num =  19 spec =    3757.81

"Menu" returns.
Ending of source

Click "Exit".

> ... written the PHA data Extension
>Completed BCMPPHA Ver 1.0.0

her_s_1_143.pha has been created under "data_dir".

(5)Make a background PHA file using FTOOLS:bcmppha

select b (source) above at

>Please enter file mode Background or Source[ ]b

Consider spectra number 1-6 & 19 - 27 as "background". bcmppha asks

> Click left mouse button to get the position

click left mouse button at "1"

> Click right mouse button to fix the position and exits cursor
> Chose spectra number: b1

then click right mouse button to determine the begining point as the left part of background (b1). The dotted line appears as follows.

Beginning of background 1

>spec_num =  1 spec =    5235.08
>Chose spectra number: b2

Move cursor to "6" and click left mouse button then click right mouse button to determine the ending point as the left part of background (b2). The dotted line appears as follows.

Ending of background 1

>spec_num =  6 spec =    3388.49
>Chose spectra number: b3

Repeat for "19" and  "27" as the beginning and ending points of the right part of background
b3 and b4 respectively.

>Chose spectra number: b3
> spec_num =  19 spec =    3757.81
> Chose spectra number: b4
> spec_num =  27 spec =    4311.78

"Menu" returns.
background 2
Click "Exit".

>... written the PHA data Extension
> Completed BCMPPHA Ver 1.0.0

(6)Make a RMF file from a DRM file

Type: fbdrm2rmf her_drm_1_143.fits her_bfits_1_143.rmf

(7)Use XSPEC

Now you are ready to use XSPEC with her_s_1_143.pha, her_b_1_143.pha
and  her_bfits_1_143.rmf.

Inside XSPEC

XSPEC> data her_s_1_143.pha
>Net count rate (cts/s) for file   1  1.6945E+04+/-   50.06
>using response (RMF) file...       her_bfits_1_143.rmf
>1 data set is in use

XSPEC> back her_b_1_143.pha
> Net count rate (cts/s) for file   1  1.2865E+04+/-   50.24    ( 75.9% total)
> using response (RMF) file...       her_bfits_1_143.rmf
> using background file...           her_b_1_143.pha

XSPEC> cpd /xw
XSPEC> plot data
XSPEC data plot
XSPEC> ig 1-8
XSPEC> ig 70-130
XSPEC> plot
XSPEC data plot 2
XSPEC> setp e
XSPEC> p
XSPEC data plot with energy
XSPEC> mo grbm
>Model:  grbm[1]
>Input parameter value, delta, min, bot, top, and max values for ...
>                  -1      0.01       -10        -3         2         5
>1:grbm:alpha>
>                  -2      0.01       -10        -5         2        10
>2:grbm:beta>
>                 300        10        10        50     1E+03     1E+04
>3:grbm:tem>
>                   1      0.01         0         0     1E+24     1E+24
>4:grbm:norm>
>  ---------------------------------------------------------------------------
>  ---------------------------------------------------------------------------
>  Model:  grbm[1]
>  Model Fit Model Component  Parameter  Unit     Value
>  par   par comp
>    1    1    1   grbm       alpha              -1.000     +/-      0.
>    2    2    1   grbm       beta               -2.000     +/-      0.
>    3    3    1   grbm       tem      keV        300.0     +/-      0.
>    4    4    1   grbm       norm                1.000     +/-      0.
>  ---------------------------------------------------------------------------
>  ---------------------------------------------------------------------------
> Chi-Squared =      887533.3     using    61 PHA bins.
> Reduced chi-squared =      15570.76     for     57 degrees of freedom
> Null hypothesis probability =    0.

XSPEC> fit
> Chi-Squared    Lvl  Fit param # 1     2           3           4
>   2115.55     -2    -0.4637      -2.675       319.2      0.1775
>   1119.60     -3    -0.4418      -8.193       315.9      0.1690
>   343.880     -4    -0.3572      -9.085       254.7      0.1789
>   284.181     -2    -0.3277      -9.303       236.3      0.1907
>   261.591     -2    -0.2795      -9.342       219.0      0.1992
>   261.591      3    -0.2795      -9.309       219.0      0.1992
> ---------------------------------------------------------------------------
> Variances and Principal axes :
>               1     2     3     4
> 6.68E-07 | -0.14  0.00  0.00 -0.99
> 9.14E-05 |  0.99  0.00  0.00 -0.14
> 7.91E+01 |  0.00  0.00  1.00  0.00
> 9.34E+06 |  0.00 -1.00  0.00  0.00
>  ---------------------------------------------------------------------------
>  ---------------------------------------------------------------------------
>  Model:  grbm[1]
>  Model Fit Model Component  Parameter  Unit     Value
>  par   par comp
>    1    1    1   grbm       alpha             -0.2795     +/-  0.4146E-01
>    2    2    1   grbm       beta               -9.309     +/-   3057.
>    3    3    1   grbm       tem      keV        219.0     +/-   8.915
>    4    4    1   grbm       norm               0.1992     +/-  0.4108E-02
>  ---------------------------------------------------------------------------
>  ---------------------------------------------------------------------------
> Chi-Squared =      261.5908     using    61 PHA bins.
> Reduced chi-squared =      4.589312     for     57 degrees of freedom
> Null hypothesis probability = 5.564E-28
 

XSPEC> plot data
data and folded model
XSPEC> plot data res
data and folded model with residuals
XSPEC> plot uf
unfolded spectrum
XSPEC> exit
Do you really want to exit (y)
XSPEC: quit