NAME

xatime - Calculate times and populate the TIME column for all XRISM science and housekeeping data

USAGE

xatime infile outfile timfile lookupfile

DESCRIPTION

The task xatime assigns times to all XRISM science and HK data files. By default, the calculated times are written in the column TIME (see parameter 'timecol') for science and HK data files, and in the columns START and STOP for GTI files. Only for the HK files are the times also written as UTC time in the columns YYYY, DDD, HH, MM, SS, and US. The time calculation always requires the following supporting input files: a) the TIM file ('timfile') containing the TI vs. TIME relation; b) the CalDB column definition file ('coldeffile') containing the column names appropriate for the instrument; and c) the leap seconds file ('leapsecfile'). All science data also require the CalDB delay file ('delayfile') containing the delay added last to the calculated time. The Resolve science data also require a look-up table stored in the instrument-specific HK extension for fine time assignment. The delay file and the HK look-up table are not required when calculating the times for the HK file.

The framework to assign time is based on a three-step process using two different look-up tables. For Resolve science files, the xatime task first derives the fine time, in units of L32TI, using a look-up table in the instrument HK (step 1). The fine time is assigned internally by the instrument processor. Next, the xatime task derives the time using the look-up table in the TIM files providing the TI vs. TIME relation (step 2). Lastly, when appropriate, the task adds a delay time between the on-board computer and the instrument (step 3). For HK data, step 1 and 3 are skipped because there is no need for a fine time assignment. An exception is the Resolve MXS HK, where a delay time is added (step 3). For Xtend science files, step 1 is skipped because the event data already includes fine time information, but the xatime task calculates the times considering the DATAMODE (if DATAMODE is WINDOW1, WINDOW2, WINDOW1BURST, or WINDOW2BURST), and this requires several keywords to be present in the event file (TIMEDEL, TIMTRANB, EXPDEADB, TIMTRANA, EXPDEADA, FLUSHIMB, LASTDEAD, LASTDEL, NOMEXPO, and TIMEPIXR).

The xatime task updates header keywords (TSTART, TSTOP, DATE-OBS, and DATE-END) in the primary and table extensions of the target FITS file. The smallest and largest values of the TIME column are used to calculate the values of these keywords. If the file contains more than one extension, as for the case of an HK file, the xatime task calculates time in all extensions. The header keywords in this case, are updated as follows: the primary header TSTART and TSTOP correspond to the smallest start and the largest stop values, considering all the extensions, while in each extension the TSTART and TSTOP are based on the smallest and largest times in the TIME column of the extension. The TIME column output from the xatime task is not time ordered.

PARAMETERS

infile [filename]
Name of the input file to calculate the times; this is either a science or HK file.

outfile [filename]
Name of output file with calculated times assigned.

timfile [filename]
Name of the input TIM file. This file contains the look-up table for the TI vs. TIME conversion.

lookupfile = NONE [filename NONE|file name]
Name of the input HK file containing local time information. This file contains the look-up table that is required only when times are calculated for the Resolve science files.

(leapsecfile = REFDATA) [filename REFDATA|CALDB|file name]
Name of the file giving the table of leap seconds. If set to CALDB or REFDATA, the file is read from the calibration database, CalDB, or the REFDATA area, respectively..

(coldeffile = CALDB) [filename CALDB|file name]
Name of the input file that contains the column names to use for each instrument and HK for the time calculation. If 'coldeffile=CALDB', the column names are obtained from a file in CalDB.

(delayfile = CALDB) [filename CALDB|file name]
Name of the input file that contains the time delays that are added to the science times. If 'delayfile=CALDB', the time delays are obtained from a file in the CalDB

(timecol = TIME) [string]
Name of the column to which the calculated times are written.

(gticolums = START,STOP) [string]
Names of the columns to which the times are written in a GTI file.

(calctime = yes) [boolean yes|no]
Flag to perform time assignment. Valid only when processing an HK file.

(calcutc = yes) [boolean yes|no]
Flag to update UTC columns in the HK files. Valid only when processing an HK file.

(writekeys = yes) [boolean yes|no]
Flag to write the timing keywords in the header of the output file.

(interp = TWOPOINT) [string NEAREST|TWOPOINT|FOURPOINT]
Method of interpolation.

(buffer = -1) [integer -1|0|N]
Rows to buffer (-1=auto, 0=none, N>0=number of rows).

(clobber = no) [boolean yes|no]
Overwrites the existing output file if set to yes.

(chatter = 1) [integer 0|1|2|3]
Chatter level for output. Set to 0 to suppress output, or to 1, 2, or 3 for increasing the chatter of the output.

(logfile = !DEFAULT) [string]
Log file name. If set to DEFAULT, uses the name of the task and, if preceded by "!", overwrites the file if it exists. If set to NONE, no log file is created.

(debug = no) [boolean yes|no]
Diagnostic output is printed to the screen if set to yes.

(history = yes) [boolean yes|no]
Records task parameters in HISTORY.

EXAMPLES

  1. Calculate times for a XRISM/Resolve HK file (OBSID 100050010) using the associated TIM file. For the HK file, the 'lookupfile' is set to NONE.
  2.    xatime infile=xa100050010gen_a0.hk1 outfile=xa100050010gen_out.hk timfile=xa100050010.tim lookupfile=NONE
    
  3. Calculate times for a Resolve event file (OBSID 100050020) using the associated TIM file. The Resolve event file also requires an associated 'lookupfile'.
  4.    xatime infile=xa100050020rsl_p0px1010_uf.evt outfile=xa100050020rsl_out.hk timfile=xa100050020.tim lookupfile=xa100050020rsl_a0.hk1
    

LAST MODIFIED

June 1, 2023