The ahscreen Perl script screens science event files by applying an expression that filters on specified columns in the file, and/or by applying a GTI file (generally, the GTI created by the ahgtigen task).
The input specified by the 'infile' parameter is an event file, or list of event files (the name of the text file with the list, preceded by "@"). If multiple input files are specified, the files are merged prior to screening. One or two output files are created. The first is the output (screened) event file, with file name given by the 'outfile' parameter. The second file is an optional GTI file, and it is created when the parameter 'mergegti' is set to NONE. In this case, the combined input GTI are not attached to the output events file, but instead the GTI are written to a separate file (merged using an AND operation), the name of which is equal to the root name of 'outfile', with extension .gti. In the case that the parameter 'mergegti' is set to AND or OR, the input GTI are merged with the logical operator specified by 'mergegti' and appended in an additional extension in the output events file.
Note that any extensions in the input files that are not named EVENTS are not copied to the final output events file. The user may filter on a single GTI file, or a list of GTI files, by setting the 'gtifile' parameter (in the latter case by preceding the name of the list text file with "@"). If GTI are being used for filtering, the GTI must be specified in the 'gtifile' parameter, including any GTI attached to the input event file(s). If there is no input GTI file or GTI extension, no GTI screening is performed.
Following the GTI screening, the filtering proceeds by applying a filtering expression on columns present in the event file. Users may specify an expression via the 'expr' parameter, or use a pre-existing CALDB filtering expression stored in the label file, specified by the 'selectfile' parameter. The label file is a FITS file containing several expressions, each with a label that identifies the filtering details (the screening expression and the type of file the expression is applied to) used to screen events and create the GTI. A user-input label file may also be used via the 'selectfile' parameter. A single label, or any combination of labels in the form of a comma-separated list, may then be specified using the 'label' parameter.
Users may update the timing keywords (EXPOSURE, TSTART, TSTOP, etc.) using the 'upkeyword' parameter. Other keywords may be copied from the first input file into the final file using the 'cpkeyword' parameter.
There are three types of error codes returned from ahscreen:1. Fatal : Error during ahscreen 2. Non-Fatal : Zero exposure time after merging GTI 3. Non-Fatal : All events were rejected during screening, based on the filtering criteria
The final output is a single, filtered event file with fewer rows than the input file, and a GTI file if 'mergegti=NONE'.
ahscreen infile=xa100050020rsl_p0px1010_uf.evt outfile=xa100050020rsl_p0px1010_cl.evt expr="ITYPE<5"
ahscreen infile=xa100050020rsl_p0px1010_uf.evt outfile=xa100050020rsl_p0px1010_cl.evt expr=NONE selectfile=CALDB label=PIXELALL
ahscreen infile=xa100050020rsl_p0px1010_uf.evt outfile=xa100050020rsl_p0px1010_cl.evt gtifile=xa100050020_gen.gti \ expr=NONE selectfile=CALDB label=PIXELALL mergegti=AND