batupdatephakw - update BAT ray tracing columns in spectral files


batupdatephakw infile auxfile


batupdatephakw updates the BAT ray tracing columns in a mask weighted spectrum. This is important especially for gamma-ray bursts or other events where the spacecraft has slewed. Without the update, the keywords will reflect the ray tracing status at the end of the event data set, which will lead to an erroneous detector response matrix.

The ray tracing quantities that are updated are: MSKWTSQF, NGOODPIX, PCODEFR, BAT_XOBJ, BAT_YOBJ, BAT_ZOBJ.

This script modifies the spectral file in place. Thus, the spectrum must be writeable and not compressed. New columns are created if they are not already present. If keywords with the same name are present, then they are deleted (to prevent confusion with the columns).

This task requires the "auxiliary" file produce by batmaskwtevt, which contains the above quantities as a function of time.


infile [filename]
Input/output spectral file. The file should be a batbinevt-derived OGIP standard Type I or Type II spectral file. The file should contain at least the TIME and EXPOSURE keywords. The file is modified in place.

auxfile [filename]
Name of the "auxiliary" ray trace file produced by batmaskwtevt. The times in the auxiliary file should overlap with the times in the spectral file.

(chatter = 2) [integer, 0 - 5]
Controls the amount of informative text written to standard output.


1. Update the ray tracing columns in a spectral file named myspectrum.pha.

        batupdatephakw myspectrum.pha auxfile.fits
auxfile.fits is the "auxiliary" file produced by batmaskwtevt.




Nov 2007