This thread describes how to make a sky image from BAT event data using the 'batbinevt' and 'batfftimage' tasks.
Read this thread if you want to: Make wide field BAT sky images.
Last update: 2007-07-17
While the BAT does not have focussing optics, it is possible to create sky images using the task batfftimage. This task combines a detector plane image and information about the coded aperture pattern to reconstruct the sky flux at each point in the field of view. Sky images have the same flux units as all other mask weighted counts values.
The steps of this procedure are: (1) make a source detector plane image using batbinevt; (2) optionally make a background detector plane image; and finally (3) to make a sky image using batfftimage.
BAT event data
for example, (in obsid/bat/event/swNNNNNNNNNNNbevshsp_uf.evt.gz);
BAT quality map,
a basic map can be found in obsid/bat/hk/swNNNNNNNNNNNbcbdq.hk.gz;
one can be created by using the "Creating a Quality Map" procedure;
Swift attitude information (in obsid/auxil/swNNNNNNNNNNNsat.fits.gz).
For example, let's assume we are interested in the burst GRB 050713A, in particular to produce an image of the "flare" from time 142921843 (MET) to 142921868 (MET).
Change directories to the location of the event data.
cd 00145675000/bat/event
A Detector Plane Image (DPI) is a map of the counts (or count rate) in each detector as it is layed out geographically in the detector plane. This map is the input to the deconvolution software.
Issue the following command,
batbinevt infile=sw00145675000bevshsp_uf.evt.gz outfile=flare.dpi outtype=DPI \ timedel=0.0 timebinalg=u tstart=142921843 tstop=142921868 \ energybins=14-150 outunits=RATE weighted=NO ecol=ENERGY \ detmask=../hk/sw00145675000bcbdq.hk.gz clobber=YES
where
outtype=DPI means to make a DPI
timedel=0.0 means accumulate all the data into one single DPI
timeginalg=u means make them uniform time bins (really "don't care" in this case)
the tstart and tstop give the start and stop time of the spectrum as discussed above
the energybins=14-150 means make a single image in the 14-150 keV range
the ecol=ENERGY means use the ENERGY column for energy selections
the outunits=RATE makes a rate image
the weighted=NO means do not perform background subtraction
the detmask is required to filter out noisy detectors
The result should be a single detector plane image. It is also possible to select multiple time ranges or multiple energy bands. batfftimage will automatically process these to produce sky images in multiple slices.
Making a background detector plane image is optional, but it will increase the sensitivity of the image when bright sources are present. If possible, the background interval should be made from data with similar background levels and for a longer duration than the source image.
Use the same procedure as above to create a DPI file during a time range when you know there is no source emission. Let us call that file "bkg.dpi".
NOTE: if the background or bright sources are known to have varied significantly between the time of the source and background DPIs, there may be little or no benefit to making a background file.
Advanced usage: if bright sources are known to be present in the image, it is possible to use the batclean task to create a background map which removes many systematic artifacts. This is usually not necessary for images with exposures less than 100 seconds.
A sky image is created from a DPI using the 'batfftimage' task. Issue the following command,
batfftimage infile=flare.dpi outfile=flare.img attitude=../../auxil/sw00145675000sat.fits.gz \ bkgfile=bkg.dpi detmask=../hk/sw00145675000bcbdq.hk.gz clobber=YES
where
infile is the DPI file name
bkgfile is the background DPI file name ('NONE' can also be used if no background file is available)
outfile is the output sky image file name
attitude is the spacecraft attitude file name
detmask is the detector quality map
The result is a BAT sky image. If valid spacecraft attitude data was used, then the sky image should automatically have celestial coordinates (WCS keywords) attached.
You may use your favorite FITS image viewer to examine the image (for example FV or DS9).
Figure 1 shows the appearance of a typical bright point source in a BAT sky image.
The spacecraft attitude may have changed during the accumulation interval of your DPI. You must carefully filter out spacecraft slew data and use only steady pointed attitude information, or the celestial coordinate system will be erroneous.
As described elsewhere, the BAT has a large field of view with a large variation in sensitivity. The partial coding map describes the fraction of the detector array which is illuminated by each point on the sky. To make a partial coding map, issue the following command,
batfftimage infile=flare.dpi outfile=flare.pcodeimg attitude=../../auxil/sw00145675000sat.fits.gz \ bkgfile=bkg.dpi detmask=../hk/sw00145675000bcbdq.hk.gz clobber=YES pcodemap=YES
Note that the only change from the previous call is to use the parameter "pcodemap=YES", and to change the output file name.
2007-01-09 - initial draft
2007-07-17 - fix attitude path in batfftimage commands