batdrmgen-multi is a convenience routine which creates a many BAT response matrices by calling batdrmgen multiple times.
The input must be a "type II" spectrum, with one spectrum per row of the FITS file. The standard tool 'batupdatephakw' must have already been run on the spectrum file, so that special BAT ray tracing is available for each spectrum in the file.
The file must have the following standard spectral keywords:
HDUCLAS1= 'SPECTRUM' / Contains spectrum HDUCLAS2= 'NET ' / Spectrum is background subtracted HDUCLAS4= 'TYPE:II ' / Multiple PHAs in this HDUThese keywords indicate that the input file is a "type II" spectrum.
During the run, batdrmgen-multi will attempt to modify the input spectral file, if possible. It will create a column called RESPFILE, which will contain the name of the response matrix for each row. If a RESPFILE keyword exists, it will be deleted in order to prevent confusion.
The output will be a series of BAT response matrices, one for each requested row of the input file. The files will be named according to the 'outroot' parameter, as outroot_n.rsp, where n is the corresponding row number of the spectrum.
If batdrmgen fails because the source was outside of the BAT field of view, this is not strictly an error. If the source is outside of the BAT field of view, then there will be zero counts, and the response would have received zero weighting. In this case, batdrmgen-multi will note the issue and then carry onward.
For rows of the spectrum file where batdrmgen was not run successfully, either because the user chose specific rows, or if the source is outside of the field of view, then the corresponding RESPFILE entries will be 'NULL'. It is the user's responsibility to disregard those entries when processing the data downstream.
1. Create response matrices for rows 1,8,9,10 of myspec.pha. The outputs will be generated in myspec_1.rsp, myspec_8.rsp, myspec_9.rsp, and myspec_10.rsp.
batdrmgen-multi infile=myspec.pha outroot=myspec hkfile=NONE rows=1,8,9,10