NAME
ahcalctime - Rerun the timing tools on an output directory from the pipeline
USAGE
ahcalctime indir outdir
DESCRIPTION
'ahcalctime' is a script that recalculates the TIME column in the event files and the housekeeping (HK) files. As input, the script expects a directory structure as defined for a sequence downloaded from the archive.
The data from the 'indir' directory are copied to the 'outdir'. The directory structure inside
indir is the same of outdir. Only the files and directories necessary to the tools are copied over.
For example, the event_uf directory is copied, but not the event_cl.
To recalculate time the script runs the following tools:
- Runs ahmktim on the tim file, after making a copy of the original tim file.
- Runs ahtime on the general HK file
- Runs sxssamcnt on the SXS HK file
- Runs sxssamcnt on each SXS unfiltered event file
- Runs sxssamcnt on the SXS lost GTI file
- Runs ahtime on the SXS lost GTI file
- Runs ahtime on each instrument HK file
- Runs ahtime on each instrument unfiltered event file
INPUT
The input directory 'indir' must have the following directory structure:
indir/auxil/general HK file, tim file
indir/[inst]/hk/
indir/[inst]/event_uf/*uf.evt
indir/sxs/event_uf/*el.gti
This is the same structure as is output by the pipeline that is placed in the archive.
OUTPUT
The following directories and files are copied from the 'indir' to the 'outdir', and the new time is calculated only for these files:
indir/auxil/*
indir/[inst]/hk/*
indir/[inst]/event_uf/*uf.evt
indir/sxs/event_uf/*el.gti
If 'clobber=yes' and the 'outdir' exists, the 'outdir' is removed completely before beginning,
and a new copy is made from 'indir'. If 'clobber=no' and the 'outdir' exists, the script exits with a failure. All of the individual tools operate as though 'clobber=yes'.
The tools called within ahcalctime create and overwrite, for example, the existing (in the 'outdir') instrument hk file from ahtime. The files in 'indir' are untouched.
The original tim file is copied to a [base]_orig.tim, and the new tim file only keeps the
primary HDU and first extension in order to recreate the second extension.
When calling the timing tools, the script creates intermediate files, then either copies
them or moves them to their final destination, based on the 'cleanup' parameter.
PARAMETERS
- indir [string]
- Input directory
- outdir [string]
- Output directory.
- (verify_input = no) [boolean]
- Verify the input files with ftverify.
- (sorttime = yes) [boolean]
- Sort the output time column after calling ahtime, on the column specified in the 'timecol' parameter. All extensions are
sorted on this column, if that extension contains the column and has a nonzero number of rows.
- (frqtemfile = CALDB) [filename]
- Used in ahmktim: the freq vs. temp file (or CALDB)
- (sxs_coeftime = CALDB) [filename]
- Used in sxssamcnt: Input file with arrival time coefficients (or CALDB)
- (coldeffile = CALDB) [filename]
- Used in ahtime: Input file with column names for the time corrections (or CALDB)
- (delayfile = CALDB) [filename]
- Used in ahtime: Input instrument delay file (or CALDB)
- (offsetfile = CALDB) [filename]
- Used in ahtime: Input file with the CAMS offset corrections (or CALDB)
- (leapsecfile = REFDATA) [filename]
- Used in ahmktim, ahtime: Input leap second file (or CALDB, [REFDATA])
- (timext = TIM_LOOKUP) [string]
- Used in ahmktim: Output TIM extension created by the ahmktim tool.
- (gaptime = 2.0) [real]
- Used in ahmktim: Minimun time [s] to define a gap
- (timecol = TIME) [string]
- Used in ahtime: Output time column
- (gticolumns = START) [string]
- Used in ahtime: Output GTI column names
- (cleanup = yes) [boolean]
- Delete temporary files ([yes]/no)
- (clobber = no) [boolean]
- Overwrites the existing output file if set to yes (yes/[no]).
- (chatter = 1) [integer]
- 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 filename. If set to DEFAULT uses the name of the task and, if
preceded by '!', overwrite the file if it exists. If set to NONE no
log file is created.
- (debug = no) [boolean]
- Diagnostic output is printed out on the screen if set to yes
(yes/[no]).
- (history = yes) [boolean]
- Records tool parameters in HISTORY ([yes]/no).
- (mode = ql) [string ql|hl|q]
- Mode to query the parameter file.
Acceptable values include: "ql (query and learn/remember), "hl" (hidden and learn/remember), "q" (query but don't remember), "h" (hidden).(Optional)
EXAMPLES
-
ahcalctime indir outdir
The script copies the necessary files from indir to outdir, then recalculates the time columns on the files in outdir.
SEE ALSO
LAST MODIFIED
March 2016