Skip banner and navigation tools.

 |  site map

Skip sidebars of related page links.

Creating a spectrum and response matrix

BAT spectra can be extracted for the full event-list, or over a specified time by using the additional parameters tstart and tstop on the command line. These times must be in Swift MET (seconds since 2001-01-01). The time of the beginning/end of the dataset can be determined from the event-list by using fkeyprint:

> fkeyprint sw00377487000bevshsp_uf.evt+0 tst


# FILE: sw00377487000bevshsp_uf.evt
# KEYNAME: TST

# EXTENSION:    0
TSTART  =           281296394. / Start time
TSTOP   =       281381107.0579 / Stop time

In the example below, we extract a spectrum for the T90 interval, determined from battblocks dur.gti file.

>batbinevt detmask=grb.mask tstart=281296751.488 tstop=281296755.584
>Input event file name: sw00377487000bevshsp_uf.evt
>Output file name: grb.pha
>Make light-curve or spectrum: pha
>Histogram time bin size: 0
>Time binning algorithm: u
>Energy bin list: CALDB:80

The standard BAT 80 channels have been used here (CALDB:80). Note that the spectrum produced does not need to go through the grppha ftool; this last step has binned the file. Again, if you processed the BAT data using batgrbproduct as described on the index page, then the detector mask will be in the newly created auxil directory, under the name *b_qmap.fits.

A systematic error vector must be applied to the BAT spectra before use to account for residuals in the response matrix; there is a specific task to do this, called batphasyserr.

>batphasyserr
>Input spectrum filename: grb.pha
>Systematic error filename: CALDB

In order to ensure that the position of the burst in instrument coordinates is known (since the spacecraft slews, this can change, but the knowledge is required for the flux determination), the ray-tracing keywords must be correct. After the spectrum has been produced, batupdatephakw will perform this task, providing the sw[obsid]bevtr.fits ray-tracing file is present; it should be in the [obsid]/bat/event directory. Alternatively, if you have run batgrbproduct, it will be in the auxil directory, called sw[obsid]b_all.evaux [If this file is missing from the archive (possibly the case for data before late 2005), and you have not run batgrbproduct, then batmaskwtevt needs to be run to produce one: include auxfile=sw[obsid]bevtr.fits on the batmaskwtevt command line to output the ray-tracing results to a file.]

>batupdatephakw
>Input spectrum filename: grb.pha
>Auxiliary raytracing filename: sw00377487000bevtr.fits

In order to fit the BAT spectrum, finally a detector response matrix needs to be built.

>batdrmgen
>Input event PHA file name: grb.pha
>Output response matrix file name: grb.rsp

The BAT team recommend fitting the spectra between 15-150 keV, since the BAT mask becomes transparent around 150 keV. Data below 14 keV and above 195 keV should definitely be ignored. The DAP housekeeping file can be left set to NONE.

PHA2 spectra

In certain cases (for example, simultaneously fitting with Fermi-GBM spectra in XSPEC), a PHA2 format BAT spectrum may be required. In this case, when batbinevt prompts for "Make light-curve or spectrum:", the response should be pha2. When reading this PHA2 BAT spectrum into xspec, the command is data grb.pha{1}, for example.

Index