NAME gtmktime - Create Good Time Intervals (GTIs) based on selections made using the spacecraft data file variables. USAGE gtmktime scfile filter roicut evfile outfile DESCRIPTION gtmktime is used to update the Good Time Intervals (GTI) extension and make cuts based on spacecraft parameters contained in the Pointing and Livetime History (spacecraft) FITS file. A Good Time Interval is a time range when the data can be considered valid. The GTI extension contains a list of these GTIs for the file. The sum of the entries in the GTI extension of a file corresponds to the time intervals when the data in the file is "good". This is based on the spacecraft aspect history and a user specified set of selection criteria. In the case of the LAT data, the GTIs are the list of times that the LAT was collecting data over the selected time range and is also used to 'cut out' times when the selected source was close to the earth limb. Tools use the GTIs for exposure calculations. The gtmktime tool reads the spacecraft data file and, based on specified cuts, creates a set of GTIs. These are then combined (logically) with the existing GTIs in the event file, and all events outside this new set of GTIs are removed from the file. New GTIs are then written to the GTI extension of the new file. The gtmktime tool will be most commonly applied to event data; and by default the event data will be filtered according to the GTIs that are created. This tool may also be used to update GTIs in other files such as those created by gtltcube (see the gtltcube help). The cuts can be made on any field in the spacecraft data file. The default is to select times when the spacecraft is not in the Southern Atlantic Anomaly (SAA), i.e. "IN_SAA!=T". The cuts are made using C-style relational syntax like for example: ! (not), && (and), || (or), != (different), >, <, >=, <=, abs(), cos(), sin(), etc. Other kinds of cuts on the data could be made using the gtselect tool. See the gtselect documentation for further explanation. PARAMETERS scfile [filename] Spacecraft data file containing information such as the spacecraft pointing as a function of time. This file could be generated by gtorbsim for simulated observations (see the gtorbsim help for further explanation) It is normally obtained from the Fermi Science Support Center (FSSC) website and matches the time range of the requested data. (sctable) [string] Spacecraft data extension. Default is "SC_DATA". filter [string] This is the user supplied filter expression. It defines the cuts being made using a C-style relational syntax like for example: ! (not), && (and), || (or), != (different), >, <, >=, <=, abs(), cos(), sin(), etc. Default is "DATA_QUAL>0 && LAT_CONFIG==1". roicut [boolean] Apply ROI-based zenith angle cut to exclude times where the region of interest is outside the field of view. If "yes", then the code will construct a filter string expression of the form angsep(RA_ZENITH,DEC_ZENITH,RA_ROI,DEC_ROI) gtmktime This will prompt for parameter values. Not all parameter are prompted; some of them are "hidden". To change one of the "hidden" parameter, the user should specify the values in the command line or modify its mode by editing the parameter file. For example, if the user does not want to overwrite the existing output file, the user should set the parameter "clobber=no", e.g.: > gtmktime clobber=no In the following example the "_3C279_3C273_back_events_0000.fits" data file is used, along with the spacecraft data file called "spacecraft_data_file.fits". All events that fall in time ranges outside of the SAA are selected out: > gtmktime Spacecraft data file[] spacecraft_data_file.fits Filter expression[DATA_QUAL>0 && LAT_CONFIG==1] Apply ROI-based zenith angle cut[yes] Event data file[] _3C279_3C273_back_events_0000.fits Output event file name[] _3C279_3C273_back_filtered.fits The output event FITS file is called "_3C279_3C273_back_filtered.fits". The same example can be run in the command line in this way: > gtmktime scfile=spacecraft_data_file.fits \ filter="DATA_QUAL>0 && LAT_CONFIG==1" \ roicut=yes evfile=_3C279_3C273_back_events_0000.fits \ outfile=_3C279_3C273_back_filtered.fits SEE ALSO gtltcube gtorbsim gtselect