The task xtdmodegti is a Perl script that creates a good time interval (GTI) for each supported Xtend mode. The task reads as input the exposure FFF file ('infile') and the directory ('evtdir') where all available Xtend unfiltered event files for the observation are found, and creates GTI for all modes found. These GTI are later appended to the appropriate cleaned event lists, and used downstream for exposure map generation and to properly apply any user-specified time filtering.
The Xtend exposure file includes time-tagged configuration information that is specific to each CCD and segment combination. This information is telemetered separately from the event data to greatly reduce the downlink data rate, however this means the exposure and event data must be combined on the ground to recover the proper timing information for all events. xtdmodegti first creates a list of unfiltered event lists in the directory specified by 'evtdir', using 'steminputs' to match the event list filenames. It then reads the timing parameters from the header of each event list, indexing them by the DATACLASS header keyword, which encodes all of the instrument configuration information. The task then steps row-by-row through the exposure file; each time-tag in this file contains eight rows, one for each combination of CCD_ID and SEGMENT, and xtdmodegti reads these columns along with DATACLASS and several other columns describing the instrument configuration. Rows that specify unsupported, non-science modes are ignored. For each row in a supported mode, the task uses the DATACLASS-encoded timing parameters to generate a GTI entry for that timestamp and CCD_ID+SEGMENT combination, and it appends this entry to a corresponding output GTI extension. It keeps track of the total number of frames in each DATACLASS for proper calculation of the exposure time.
There are two output files whose names are set by the parameters 'outfile' and 'mergefile'. The first output ('outfile') contains a GTI extension for each DATACLASS and CCD_ID+SEGMENT combination. Each extension contains START, STOP, and frame number (FRAMENUM) columns. The task also checks if a CCD_ID+SEGMENT combination is missing, or appears more than once. The information is output to the 'logfile' of the task. The second output ('mergefile') contains a GTI extension per DATACLASS, where GTI for different CCD_ID+SEGMENT combinations are merged into one (using the 'AND' mode of the ftmgtime task). The number of unique DATACLASS values is also output to the parameter 'numdclass'.
Only times within the range specified by the 'tstart' and 'tstop' parameters are included in the output GTI. Normally, these are the start and stop times of pointed observations that exclude the slew data. If the parameters 'tstart' or 'tstop' are outside of the range covered by the exposure file, the file TSTART or TSTOP header keywords are used instead.
xtdmodegti infile=xa100050020xtd_a0exp.fits outfile=xa100050020xtd_a0exp_out.fits mergefile=xa100050020xtd_seg.gti \ tstart=47390384. tstop=47430516. evtdir="100050020/xtend/event_uf/" steminputs="xa100050020"
xtdphas, xtdflagpix, xtdpi, ftmgtime
November 1, 2023