'eeftable' is a script that creates an EEF FITS file from an output history event file from the tool xrtraytrace. This script allows the user to create EEF files without needing to run the xrtraytrace tool repeatedly. The tool reads each row in the history file, determines which are valid double reflections (meaning it had a single reflection from the primary mirror, a single reflection from the secondary mirror, and hit the results plane). The radii and energy of those photons are then used to calculate the EEF.
The input file 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 history file must be large enough to contain at least one valid photon for each radius.
The output file will have an extension containing the EEF for each off-axis angle, azimuthal angle, and energy. Each row will be the EEF for a radial value.
Off-axis angle, azimuthal angle, and/or energy may be merged in the output file using the 'mgOffaxis', 'mgAzimuth', and 'mgEnergy' parameters. If any of these are set to true, EEF values across that parameter are merged. For example, if mgEnergy=true, there will be only one extension for energy instead of one extension for each energy. The EEF values for each off-axis and azimuthal angle will be averaged across all the energies. If all three mgOffaxis, mgAzimuth, and mgEnergy are true, then there will be a single extension in the output file and all the EEF values will be merged into a single extension.
Each extension in the output file will contain keywords listing the values used to create the file, such as CBD10000, CBD20000, CBD30000, and OFFAXIS, AZIMUTH, and Energy. If no parameters are merged, those keywords will be the exact value of the off-axis angle, azimuthal angle, and energy for that extension. If any of those values of merged, the appropriate keyword will reflect the range. The CBDnnnnn keywords will be a range from first unique value to last. The OFFAXIS, AZIMUTH, and Energy keywords will be the average of the unique values.
The TOTCTS keyword contains the total numnber of photons that contributed to the EEF for that extension. If any values are merged, the sum of the photons for each parameter is used. For example, if energy is merged, then all the photons that contributed to each energy iteration are summed.
eeftable.pl in.fits out.fits 100 2.0Where in.fits is a history file with off-axis angles 0, 15, and 30 arcmin, azimuthal angles of 0 and 45 deg, and energy values of 0.5, 2.0, 3.0, 4.0 keV. There will be 24 extensions in the output file: an extension containing the radial EEF values for each off-axis/azimuth/energy.
eeftable.pl in.fits out.fits 100 2.0 mgEnergy=yesWhere in.fits is a history file with off-axis angles 0, 15, and 30 arcmin, azimuthal angles of 0 and 45 deg, and energy values of 0.5, 2.0, 3.0, 4.0 keV. There will be 6 extensions in the output file: an extension containing the radial EEF values for each off-axis/azimuth.