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.
1. Update the ray tracing columns in a spectral file named myspectrum.pha.
batupdatephakw myspectrum.pha auxfile.fitsauxfile.fits is the "auxiliary" file produced by batmaskwtevt.