NAME

arftable - Create an ancillary response function (ARF), or effective area file from the output events from the raytracing code xrtraytrace, not including any detector efficiencies

USAGE

arftable infile outfile tgtOffaxis tgtAzimuth

DESCRIPTION

'arftable' is a script that creates an ancilliary response function (ARF) FITS file from an output history event file from the raytracing tool 'xrtraytrace'. The effective area (EA) in the ARF file is due to the telescope only, and does not include any detector efficiencies. This script allows the user to create EA functions for X-ray source positions at different off-axis and azimuthal angles, without needing to run the 'xrtraytrace' tool repeatedly.

The script creates an EA for a targeted off-axis (theta) and azimuthal (roll) angle. These angles need not correspond to exact angles in any of the original raytracing runs since arftable interpolates the EA for off-grid points. The script works by finding the off-axis and azimuthal angles immediately above and below the desired values, and creating an EA for each. The script then calculates what the EA should be for the desired angles.

INPUT

The input file(s) must be in the same format as output from the tool 'xrtraytrace', containing information about the event history of every raytraced photon and details of its path. The aperture, telescope description file (TDF), azimuthal angle grid, and energy grid must be consistent across each file. Each file may contain multiple off-axis angles, and may contain multiple roll angles. The same off-axis angle cannot be in multiple history files. Note that this means that the most number of files the program will actually use is two: one for the theta below the target theta, and one for the theta above it. These two theta values could also be in the same file, in which case the program will only be using one history file. The tool handles the cases where the target theta and target azimuthal angles may be on the grid of input angles, or between the angles. But they cannot be outside of the grid of angles. For example, if the input history files are created using off-axis angles 0, 10, and 20, valid target thetas would be 0, 5, 10, and 18. Target theta values of 21 or 50 would not be valid.

OUTPUT

The output is a FITS EA file, in similar format to the output EA file from 'xrtraytrace'. Note that the file format is different to that of a standard ARF file that can be read by XSPEC and is therefore incompatible with XSPEC. There is a single extension with the EA at the desired off-axis and azimuthal angles. When a vignetting file is desired, a regular EA file is not created; only the vignetting file is created.

PARAMETERS

infile [filename]
Name of the input photon history file. Alternatively, the name of an ASCII file many be entered, preceded by an '@' character, where the file contains the list of input files, one per line.

outfile [filename]
Name of the output EA file.

(vignetting = NONE) [filename]
Name of the output vignetting file (or NONE). When a vignetting file is desired, the regular effective area file is not created; only the vignetting file is created. The file contains an extension with the ratio of the EA for each theta and azimuthal angle combination, to the EA at theta=0.
    EA(E, theta, roll)
  -----------------------
    EA(E, theta=0, roll)
  
Because of the dependence on theta=0, one of the input history files must have theta=0.

tgtOffaxis [real]
Target off-axis angle [arcmin]. This is the off-axis angle at which the desired EA should be calculated. It must be within the range of the off-axis angles in the input file(s). For example, tgtOffaxis cannot be smaller than the smallest off-axis angle in the provided input file(s).

tgtAzimuth [real]
Target azimuthal (roll) angle [deg]. This is the azimuthal angle at which the desired EA should be calculated. It must be within the range of the azimuthal angles in the input file(s). For example, tgtAzimuth cannot be smaller than the smallest azimuthal angle in the provided input file(s).

(cleanup = yes) [bool, (yes|no)]
Whether or not to delete temporary files.

(clobber = no) [bool, (yes|no)]
whether to overwrite existing output file.

(chatter = 1) [integer]
Chatter level for output.

(logfile = !DEFAULT) [string]
Set the name of the log file. Special values are DEFAULT and NONE for the default file name or no log file. The default is the name of the tool with a .log extension. For example, if running ahdemo, the default log file will be called ahdemo.log. If the parameter is set to an empty string, an error will be generated. If the parameter begins with an exclamation point (!), then any existing log file with the chosen name will be overwritten.

(debug = no) [boolean, (yes|no)]
Whether to display debugging information. If turned on, this parameter will also cause error messages to print a stacktrace in addition to the usual error message.

(history = yes) [boolean, (yes|no)]
Whether to record tool parameters in history keywords in all output files.

(mode = ql) [string, (h|hl|q|ql)]
Sets how automatic parameters are specified. Legal values are h, hl, q, and ql. Hidden parameters (h) are not presented to the user and take the default value from the parameter file, but can be specified as command-line arguments. Queried parameters (q) are prompted for input from the user, but give the default value from the parameter file as a choice. Either type with learning enabled (e.g. ql) cause the default value to change to that given in the previous run.

EXAMPLES

  1. Create an EA file from multiple photon history files.
            arftable.pl @history_files.txt arf.fits tgtOffaxis=35 tgtAzimuth=50
          
    Where the input file is an ascii file listing three history files, with off-axis angles 0 and 30 arcmin, 40 and 50 arcmin, and 60 and 70 arcmin respectively. Each history file uses the same azimuthal grid of 0, 45, and 90 deg, and same energy grid of 0.5, 2.0, 3.0 keV.
            history_0_30.fits
            history_40_50.fits
            history_60_70.fits
          
    Note that since the target off-axis is 35 arcmin, only the first two history files will be used. If the target off-axis were 25, then only the first file would be used. The output EA file would be the effective area calculated at the target off-axis and azimuth, interpolated from the values in the input files.
  2. Create an EA file using angles from a single photon history file.
            arftable.pl history_0_30.fits arf.fits tgtOffaxis=0 tgtAzimuth=50
          
    Where the input file is a history file with off-axis angles 0 and 30 arcmin, azimuthal angles of 0, 45, and 90 deg, and energy values of 0.5, 2.0, 3.0 keV. The output EA file would be the effective area calculated at the target off-axis and azimuth. Since theta=0 is in the history file, only the azimuthal dependence would be interpolated.

SEE ALSO

LAST MODIFIED

February 4, 2016