NAME

ahmktim -- Calculates the relation of Time Invariant vs Time and the GTI for when the GPS is on

USAGE

ahmktim infile frqtemfile timfile outtimfile outgtifile

DESCRIPTION

'ahmktim' has two functions : a) calculate the Time Invariant vs. TIME relation (look-up table) and 2) write the GTI for when the GPS is on. The TI vs TIME look-up table is derived for each observation and it is used to assign time to all instruments and housekeeping. The relation is calculated either using the GPS , when this is on, or the on-board clock if the GPS is off (known also as Suzaku mode). To calculate TI vs TIME, 'ahmktim' uses the following files: a) the general HK file (see parameter 'infile'), b) the TIMing file (see parameter 'timfile') and c) the CALDB clock frequency vs temperature file (see parameter 'frqtemfile'). The relationship is calculated either using the GPS, when this is on, or the on-board clock if the GPS is off (known also as Suzaku mode). Both of these data are in the general HK file extensions (see parameter 'infile').
The GPS status is defined in the HK GPS extension (see parameter 'hkgpsext') by 4 flags written in columns (see parameters 'gpsacol', 'gpsbcol', 'gpsccol' and 'gpsdcol'). The combination of the 4 flags determines if the GPS is on or off. If the GPS is on the TI VS Time relation derived using the column S_TIME (rough time and correspond to the time when the packets are send to the telemetry) and L32TI (lower 32 bits of the Time Indicator) in the GPS extension. If the GPS is off, the relation is derived using the 'Suzaku mode', where the S_TIME in the GPS extension is matched with the closest time in the temperature extension (see parameter 'hktempext'). This temperature is then used to derive the frequency from the CALDB 'frqtemfile' and adjust the L32TI to when the GPS is off. The extension names for the GPS and Temperature as well as the column names depend on which on board computer , SMU (A or B), is disseminating the timing information. The TI vs TIME relationship is added as second extension (EXTNAME=TIM_LOOKUP) of the TIMing input file ('timfile') which includes three columns: TIME, L32TI and STATUS. The STATUS column is a 10 bits column indicating the following status:

    Bit 1:1  Legal or illegal                          0=ok 1=not ok 
    Bit 2:3  Mode : GPS/suzaku transition              00=GPS mode 01=Suzaku mode 10=transition   
    Bit 4:5  Indicate status in transition region      00=monotonic 10=skip 11= duplicate 
    Bit 6:10 indicate error of illegal status 
'ahmktim' calculates the GTI to when the GPS is on using the 4 flags written in HK GPS extension.

PARAMETERS

infile [filename]
Name of the general HK file containing the GPS and temperature extensions. This file is named ahgen_a0.hk1.

frqtemfile [filename]
Name of the calibration file containing the freq vs. temp relation. The parameter is set by default to CALDB.

timfile [filename]
Name of the input TIM file, containing the extension TIM_PACKETS.

outtimfile [filename]
Name of the output TIM file where the calculated TIM_LOOKUP extension is added.

outgtifile [filename]
Name of the output GTI file containing the intervals when the GPS is on.

(leapsecfile = REFDATA) [string]
Name of the input leap second file. If set to CALDB or REFDATA uses the leapsecond file in either CALDB or REFDATA area.

(hkgpsext = HK_GPS) [string]
Name of the extension with the GPS information in the general HK file (see 'infile'). This is HK_SMU_A_DHFS_SIB2GEN_dhfs_tlm_attseq and HK_SMU_B_DHFS_SIB2GEN_dhfs_tlm_attseq for the SMUA and SMUB respectively. The default is for SMUA.

(hktempext = HK_HCE) [string]
Name of the extension with the temperature information in the general HK file (see 'infile'). This is HK_SMU_A_AUX_HCE_HK2 and HK_SMU_B_AUX_HCE_HK3 for the SMUA and SMUB respectively. The default is for SMUA.

(timext = TIM_LOOKUP) [string]
Name of output extension in TIM file.

(gaptime = 2.0) [real]
Minimum value in sec to define a gap.

(stimecol = S_TIME) [string]
Name of the column containing S_TIME in the GPS extension.

(l32ticol = L32TI) [string]
Name of the column containing the L32TI in the GPS extension.

(tempcol = TEMP) [string]
Name of the column containing quartz temperature in the temperature extension. This is HCE_A_SENS_SMU_A_TEMP_CAL or HCE_B_SENS_SMU_B_TEMP_CAL for SMUA or SMUB respectively.

(packheadcol = PACKET_HEADER) [string]
Name of the column containing packet header. This counts subsequent packet and it is compared with their relative L32TI to determine whether or not there are dropped packets between two GPS measurements or large gap between two measurements.

(gpsacol = GPSA) [string]
Name of the column containing the GPS_A on/off flag. This is SMU_A_DHFS_TI_MNG_TIM_CRNT_TIM or SMU_B_DHFS_TI_MNG_TIM_CRNT_TIM for SMUA or SMUB respectively. The default is for SMUA.

(gpsbcol = GPSB) [string]
Name of the column containing the GPS_B on/off flag. This is SMU_A_DHFS_TI_MNG_TIM_GPS_SYC_STAT or SMU_B_DHFS_TI_MNG_TIM_GPS_SYC_STAT for SMUA or SMUB respectively. The default is for SMUA.

(gpsccol = GPSC) [string]
Name of the column containing the GPS_C on/off flag. This is SMU_A_DHFS_TI_MNG_TIM_AUT_SYC or SMU_B_DHFS_TI_MNG_TIM_AUT_SYC for SMUA or SMUB respectively. The default is for SMUA.

(gpsdcol = GPSD) [string]
Name of the column containing the GPS_D on/off flag. This is SMU_A_DHFS_TI_MNG_TIM_GPS_STAT or SMU_B_DHFS_TI_MNG_TIM_GPS_STAT for SMUA or SMUB respectively.
The default is for SMUA.

(suzdrifttime = 100.) [string]
The maximum time intervals, in seconds, to calibrate the suzaku with the ground base measurements.

(buffer = -1) [integer]
Rows to buffer (-1=auto, 0=none, >0=numrows).

(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).

EXAMPLES

1. Calculate a TIM_LOOKUP and a GPS GTI that are written in the file output.tim and gps.gti respectively using as the general HK file gen.hk , the CALDB file for the frequency vs temperature and the input tim file input.tim for the SMUA.


 ahtime infile=gen.hk1 frqtemfile=CALDB timfile=input.tim outtim=output.tim outgtifile=gps.gti 
 hkgpsext=HK_SMU_A_DHFS_SIB2GEN_dhfs_tlm_attseq hktempext=HK_SMU_A_HCE_HCE_A_SENS_STS
 tempcol=HCE_A_SENS_SMU_A_TEMP_CAL gpsacol=SMU_A_DHFS_TI_MNG_TIM_CRNT_TIM 
 gpsbcol=SMU_A_DHFS_TI_MNG_TIM_GPS_SYC_STAT gpsccol=SMU_A_DHFS_TI_MNG_TIM_AUT_SYC  
 gpsdcol=SMU_A_DHFS_TI_MNG_TIM_GPS_STAT

SEE ALSO

LAST MODIFIED

February 2, 2016