NAME

cams2det - Calculate offsets and rotations in HXI coordinates using CAMS telemetry input

USAGE

cams2det infile1 infile2 outfile instrume

DESCRIPTION

'cams2det' calculates HXI coordinate system offsets and rotations due to the wobbling of the Extended Optical Bench. The two input files are telemetry FITS files from each of CAMS1 and CAMS2. The output is a single FITS file with new columns containing the offsets in HXI RAW coordinates and the sine and cosine of the rotation angle. The output file can be converted into an attitude file by running the task 'det2att2' on the output file. 'cams2det' must be run separately on each of the two HXI units HXI1 and HXI2.

The routine matches the input TIME columns of infile1 and infile2. When a match is found, the routine uses data from both CAMS units to derive the offsets and rotation angle. If no match is found within a given tolerance (fixed in the software to 1 ms), the offset for that row is calculated based on a single CAMS unit and the rotation angle is set equal to zero.

The following columns are written to the output offset file:

TIME [s] is derived from the TIME column present in the two input CAMS data files.
DELTARAWX/DELTARAWY [pixels] is the component in the HXI RAW X/Y direction of the offset required to correct for the wobble of the HXI extended optical bench.
COSANGLE/SINANGLE is the cosine/sine of the rotation angle required to correct for the wobble of the HXI extended optical bench.
X1/X2 is the motion in the X-direction in the local coordinate system of the CAMS1/CAMS2 unit. It is copied directly from the 'X' column in the input file infile1/infile2
Y1/Y2 is the motion in the Y-direction in the local coordinate system of the CAMS1/CAMS2 unit. It is copied directly from the 'Y' column in the input file infile1/infile2
JUMPX1/X2 is the difference between successive values of X1/X2.
JUMPY1/Y2 is the difference between successive values of Y1/Y2.
QUALITY1/QUALITY2 is copied directly from the QUALITY column of infile1/infile2.
XDISTANCE/YDISTANCE [mm] is the X/Y distance between the CAMS units (X2 - X1)/(Y2 - Y1). This is calculated as an intermediate step in deriving the offset and rotation angle.
DELTASATX/DELTASATY [mm] is the offset equivalent to DELTARAWX/DELTASATY, but measured in the satellite coordinate system (SAT).
'BAD_UNITS' indicates which CAMS unit has valid data. If this equals to 0, both CAMS units have valid data, if it equals to 1, only CAMS2 has valid data and if equals 2, only CAMS1 has valid data.
CALC_QUALITY is generated internally to the code and is used to indicate one or more of the following situations.


CALC_QUALITY = 0: successful calculation of offsets and rotation (twist) angle.
CALC_QUALITY = 1: the rotation angle is not calculated because one CAMS unit has no good data.
CALC_QUALITY = 2: tiny twist angle fixed to cos(twist) = +-1, sin(twist) = 0 due to problem in the calculation of the twist angle.
CALC_QUALITY = 4: no calculation of offsets or twist angle possible.

PARAMETERS

infile1 [filename]
Name of the input CAMS1 telemetry FITS file containing the X and Y positions determined by the CAMS1 system.

infile2 [filename]
Name of the input CAMS2 telemetry FITS file containing the X and Y positions determined by the CAMS2 system.

outfile [filename]
Name of the output offsets file containing the offsets and rotation angle in HXI RAW coordinates.

(cams1teldef = CALDB) [string]
Name of the CAMS1 TelDef file. If the parameter is set to CALDB, the file is read from the calibration database.

(cams2teldef = CALDB) [string]
Name of the CAMS2 TelDef file. If the parameter is set to CALDB, the file is read from the calibration database.

(hxiteldef = CALDB) [string]
Name of the HXI1 or HXI2 TelDef file. If the parameter is set to CALDB, the file is read from the calibration database.

instrume [string: HXI1|HXI2]
Name of the HXI unit for which the offsets are to be derived.

(inext = CAMS_DATA) [string]
Name of data extension in 'infile1' and 'infile2.'

(outext = CAMS_OFFSETS) [string]
Name of the extension of the output file to which the offset data is written.

(flipsign = no) [boolean]
Flip the sign of the output offsets and angles. This parameter is used only for debugging by setting 'flipsign=yes'.

(startsys = RAW) [string
Starting coordinate system. Valid values are RAW or FOC.

(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]
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 the offsets from the CAMS unit for motions of the HXI-1 instrument. The TelDef files for the CAMS are found using a CALDB query. The TelDef file for the HXI is specified on the command line.

cams2det infile1="CAMS1.fits" infile2="CAMS2.fits" \
outfile="HXI1_offsets.fits" cams1teldef="CALDB" cams2teldef="CALDB" \
hxiteldef="hxi1_teldef.fits" instrume="HXI1" clobber=yes 

SEE ALSO

det2att2 cams2att

LAST MODIFIED

February, 2016