NAME

xacalctime - Re-run the XRISM timing tools on an output directory from the XRISM pipeline

USAGE

xacalctime indir outdir

DESCRIPTION

The task xacalctime recalculates the TIME column in XRISM event and housekeeping (HK) files. As input, the task expects a directory structure as defined for a sequence downloaded from the archive.

The data from the 'indir' directory are copied to the 'outdir' directory. The directory structure inside 'indir' is the same as in 'outdir'; only the files and directories necessary for the tasks to run are copied over. For example, the event_uf directory is copied, but not the event_cl.

To recalculate time, the script runs the following tasks:

  1. Runs xamktim on the TIM file, after making a copy of the original TIM file
  2. Runs xatime on the general HK file
  3. Runs rslsamcnt on the Resolve HK file
  4. Runs rslsamcnt on each Resolve unfiltered event file
  5. Runs rslsamcnt on the Resolve lost GTI file
  6. Runs xatime on the Resolve lost GTI file
  7. Runs xatime on each instrument HK file
  8. Runs xatime on each instrument unfiltered event file

INPUT

The input directory 'indir' must have the following directory structure (where lines with "[INST]" are repeated, substituting resolve and xtend for "[INST]"):

  indir/auxil/general HK file, TIM file
  indir/[INST]/hk/
  indir/[INST]/event_uf/*uf.evt
  indir/resolve/event_uf/*el.gti

This is the same structure as the pipeline output stored in the archive.

OUTPUT

The following directories and files are copied from 'indir' to 'outdir' and the new time is calculated only for these files:

  indir/auxil/*
  indir/[INST]/hk/*
  indir/[INST]/event_uf/*uf.evt
  indir/resolve/event_uf/*el.gti

If 'clobber=yes' and 'outdir' exists, 'outdir' is removed completely before beginning and a new copy is made from 'indir'. If 'clobber=no' and 'outdir' exists, the script exits with an error. All of the individual tasks operate as though 'clobber=yes'. The tasks called within xacalctime create and overwrite, for example, the existing instrument HK file (in 'outdir') from xatime. The files in 'indir' are left untouched.

The original TIM file is copied to a new file called [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, and either copies them or moves them to their final destination based on the value of the 'cleanup' parameter.

PARAMETERS

indir = indir/ [string]
Input directory.

outdir = outdir/ [string]
Output directory.

(verify_input = no) [boolean yes|no]
Whether to verify the input files with ftverify.

(sorttime = yes) [boolean yes|no]
If 'sorttime=yes', sort the output time column after calling xatime on the column specified in the 'timecol' parameter. All extensions are sorted on this column if the extension contains the column and has a nonzero number of rows.

(frqtemfile = CALDB) [filename CALDB|file name]
Parameter for xamktim: The frequency vs. temperature file.

(rsl_coeftime = CALDB) [filename CALDB|file name]
Parameter for rslsamcnt: Input file with arrival time coefficients.

(coldeffile = CALDB) [filename CALDB|file name]
Parameter for xatime: Input file with column names for the time corrections.

(delayfile = CALDB) [filename CALDB|file name]
Parameter for xatime: Input instrument delay file.

(leapsecfile = REFDATA) [filename REFDATA|CALDB|file name]
Parameter for xamktim, xatime: 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.

(timext = TIM_LOOKUP) [string]
Parameter for xamktim: Output TIM extension created by the xamktim task.

(gaptime = 2.0) [double]
Parameter for xamktim: Minimum time [s] to define a gap.

(timecol = TIME) [string]
Parameter for xatime: Output time column.

(gticolumns = START,STOP) [string]
Parameter for xatime: Output GTI column names.

(cleanup = yes) [boolean yes|no]
Delete temporary files if 'cleanup=yes'.

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

(chatter = 2) [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 DEFAULT|NONE|file name]
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. The script copies the necessary files from 'indir' to 'outdir', and recalculates the time columns on the files in 'outdir'.
       xacalctime indir=100050020/ outdir=100050020_xacalc/
    

SEE ALSO

xapipeline, xamktim, xatime, rslsamcnt

LAST MODIFIED

June 12, 2023