NAME
ahtime - Calculate times and populate the TIME column for all Hitomi science and housekeeping data
USAGE
ahtime infile outfile timfile lookupfile
DESCRIPTION
The task ahtime assigns times to all Hitomi 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 (parameter 'timfile')
containing the TI vs. TIME relation; b) the CALDB column definition file (parameter 'coldeffile') containing
the column names appropriate for the instrument; and c) the leap seconds file (parameter 'leapsecfile').
All science data also require the CALDB delay file (parameter 'delayfile') containing the delay added last
to the calculated time. The SGD, HXI, and SXS 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, except for HXI and SGD.
For the CAMS, an input CALDB file containing the offsets of the individual measurements relative to a time stamp is also necessary.
The framework to assign time is based on a three-step process using two different look-up tables. For
SGD, HXI, and SXS science files, ahtime 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, ahtime derives the time using the look-up table in the TIM files providing the TI vs. TIME relation (step 2).
Lastly, when appropriate, it 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. The exceptions are
the CAMS and MXS HK, where a delay time is added (step 3).
For SXI science files, step 1 is skipped because the event data already includes fine time information,
but ahtime 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 task ahtime 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, ahtime 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 ahtime is not time ordered.
PARAMETERS
- infile = test.hk [filename]
- Name of the input file to calculate the times; this is either a science or HK file.
- outfile = test.hk.out [filename]
- Name of output file with calculated times assigned.
- timfile = test.tim [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 HXI, SGD, or SXS science files and for the HXI/SGD HK 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 the 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.
- (offsetfile = CALDB) [filename CALDB|file name]
- Name of the input file containing offsets specific for the CAMS subsystem.
If 'offsetfile=CALDB', the offsets 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
- Calculate times for an HK file (infile.hk) using the TIM file infile.tim. For the HK file, the 'lookupfile' is set to NONE.
ahtime infile.hk outfile.hk infile.tim NONE
- Calculate times for an SXS event file, infile.evt, using the TIM file infile.tim. The SXS event file requires a 'lookupfile', which is set to sxsinfile.hk.
ahtime sxsinfile.evt outfile.hk infile.tim sxsinfile.hk
LAST MODIFIED
June 1, 2023