NAME

cams2att -- Computes a time-dependent delta-attitude file

USAGE

cams2att infile1 infile2 outfile instrume

DESCRIPTION

'cams2att' calculates a time-dependent delta-attitude file using the CAMS telemetry data describing the wobbling of the Extended Optical Bench relative to the Fixed Optical Bench. The output may be used by 'coordevt' to calculate HXI ACT coordinates (wobble removed) given the RAW coordinates (subject to the wobble). 'cams2att' is instrument-specific and must be run separately on each of the two HXI units, HXI1 and HXI2.

'cams2att' runs in five steps to correct and filter the original CAMS data, calculate and filter intermediate offsets, and generate the attitude file. Any contiguous sequence of these steps can be run, using the 'startstep' and 'stopstep' parameters. The output file from Step i is used as the input file to Step i+1. At each step, the intermediate file is saved only if the 'cleanup' parameter is set to 'no' and a name for that file is specified by the parameter corresponding to that step ('tempcorfile1/tempcorfile2', 'prefiltfile1/prefiltfile2', 'offsetfile', or 'filtoffset'). The clobber parameter applies to all intermediate files that are specified by name.

The five processing steps are:

Step 1. Correct the CAMS displacement data for temperature variations. This step reads the input 'X_RAW' and 'Y_RAW' columns and to the 'X' and 'Y' columns in the first intermediate output file.

Step 2. Filter the temperature-corrected files using ftselect and the expression specified by the 'prefiltexpr' parameter. This step removes rows with invalid CAMS displacement data.

Step 3. Run 'cams2det' for the HXI unit specified by the 'instrume' parameter. 'cams2det' calculates the offsets and rotations in HXI RAW coordinate space, based on the CAMS displacements.

Step 4. Filter the offset files using 'ftselect' and the expression given by the 'filtexpr' parameter. This step removes rows with poor quality calculations or those missing data from one of the CAMS units. It also generates a good-time interval file using maketime.

Step 5. Run 'det2att2' to convert the offsets and rotations in HXI coordinate space into quaternions.

PARAMETERS

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

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

outfile [string]
Name of output file containing the time-dependent delta-attitude quaternions for conversion from the HXI RAW to ACT system.

instrume [string: HXI1|HXI2|1|2]
Name of HXI unit for which output is calculated.

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

(camstempxy = CALDB) [string]
Name of the CAMS temperature compensation file. If the parameter is set to CALDB, the file is read from the calibration database.

(startstep = 1) [integer]
The beginning step for processing within 'cams2att.' The five processing steps are listed in the description above. Possible values range from 1 to 5.

(stopstep = 5) [integer]
The final step for processing within 'cams2att.' The five processing steps are listed in the description above. Possible values are from 1 to 5.

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

(outext = CAMS_OFFSETS) [string]
Name of the data extension in the output file from step 1 (see parameters 'tempcorfile1' and 'tempcorfile2').

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

(tempcorfile1 = NONE) [string]
Name of the temperature-corrected CAMS1 displacement file. This may either be an output file if startstep=1 or an input file if startstep=2. The file is written by 'ftcalc' in Step 1, and it is read by 'ftselect' in Step 2. If startstep=1, 'tempcorfile1=NONE' and 'cleanup=yes', the file is deleted. If 'cleanup=no' the file is named 'tmp_tempcorfile1.fits'.

(tempcorfile2 = NONE) [string]
Name of the temperature-corrected CAMS2 displacement file. See description of 'tempcorfile1.'

(prefiltfile1 = NONE) [string]
Name of the filtered, temperature-corrected CAMS1 displacement file. This may either be an output file if startstep<3 or an input file if startstep=3. This file is written by 'ftselect' in Step 2, and it is read by 'cams2det' in Step 3. If startstep=1 or startstep=2, 'prefiltfile1=NONE' and 'cleanup=yes', the file is deleted. If 'cleanup=no' the file is named 'tmp_prefiltfile1.fits'.

(prefiltfile2 = NONE) [string]
Name of the filtered, temperature-corrected CAMS2 displacement file. See description of 'prefiltfile1.'

(offsetfile = NONE) [string]
Name of the intermediate unfiltered offset file. This may either be an output file if startstep<4 or an input file if startstep=4. This file is written by 'cams2det' in step 3 and read by the 'ftselect' in Step 4. If startstep=1, startstep=2, or startstep=3, 'offsetfile=NONE' and 'cleanup=yes', the file is deleted. If 'cleanup=no' the file is named 'tmp_offsetfile.fits'.

(filtoffset = NONE) [string]
Name of the intermediate offset file after filtering. This may either be an output file if startstep<5 or an input file if startstep=5. This file is written by the 'ftselect' in step 4 and read by 'det2att2' in Step 5. If startstep=1, startstep=2, startstep=3, or startstep=4, 'filtoffset=NONE' and 'cleanup=yes', the file is deleted. If 'cleanup=no' the file is named 'tmp_filtoffset.fits'.

(prefiltexpr = "DSP_UP==1 && IS_SAMPLING==1" [string]
Expression used by 'ftselect' to filter the temperature corrected CAMS data files 'tempcorfile1' and 'tempcorfile2.'

(filtexpr = "BAD_UNITS==0" [string]
Expression used by 'ftselect' to filter the 'offsetfile.'

(gtiexpr0 = "BAD_UNITS==0") [string]
Expression used to create GTI for both CAMS units.

(gtiexpr1 = "BAD_UNITS==2") [string]
Expression used to create GTI for CAMS1.

(gtiexpr2 = "BAD_UNITS==1") [string]
Expression used to create GTI for CAMS2.

(gtifile = camsboth.gti) [string]
Name of the CAMS GTI file output by Step 4. Extension i is created using 'gtiexpr(i-1)'.

(startsys = RAW) [string]
Origin coordinate system for transformation done by 'det2att2.' It can be either RAW or FOC.

(deltaxcol = DELTARAWX) [string]
Column name for change in X coordinate in the file 'filtoffset' read by 'det2att2' in Step 5.

(deltaycol = DELTARAWY) [string]
Column name for change in Y coordinate in the file 'filtoffset' read by 'det2att2' in Step 5.

(sincol = SINANGLE) [string]
Column name for sine of rotation angle in the file 'filtoffset' read by 'det2att2' in Step 5.

(coscol = COSANGLE) [string]
Column name for cosine of rotation angle in the file 'filtoffset' read by 'det2att2' in Step 5.

(cleanup = yes) [boolean]
Delete temporary files? ([yes]/no).

(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]
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. Run 'cams2att' with user-selected parameters for filtering and GTI expressions. Specify that the attitude is for HXI2. Also save the intermediate files produced by steps 2, 3, and 4 under user-specified names, but delete those from step 1:

cams2att infile1="CAMS1.fits" infile2="CAMS2.fits" \
outfile="HXI2_attitude.fits" \
cams1teldef="CALDB" cams2teldef="CALDB" hxiteldef="CALDB" \
camstempxy="CALDB" instrume="HXI2" clobber=yes \
prefiltexpr="FLAGS == 3 && ERROR == 0" \
filtexpr="((CALC_QUALITY==0 || CALC_QUALITY == 2) && (COSANGLE > 
0.9))" \
gtiexpr0="BAD_UNITS==0 && CALC_QUALITY == 0" \
gtiexpr1="BAD_UNITS==2 && CALC_QUALITY == 0" \
gtiexpr2="BAD_UNITS==1 && CALC_QUALITY == 0" \
cleanup=yes tempcorfile1="NONE" tempcorfile2="NONE" \
prefiltfile1="CAMS1-filt.fits" prefiltfile2="CAMS2-filt.fits" \
offsetfile="nofilter_off.fits" filtoffset="postfilter_off.fits"

2. 'cams2att' can be started and stopped at different steps by employing non-default values of the 'startstep' and 'stopstep' parameters. Any combination of 'startstep' and 'stopstep' is allowed, as long as 'stopstep' is greater than or equal to 'startstep.' The user must be careful with filenames when specifying non-default values for 'startstep' and 'stopstep.' If the parameter 'startstep' is set to 1, 'infile1' and 'infile2' must be CAMS data but if the paramter 'startstep' is set to a number greater than 1, 'infile1' and 'infile2' are ignored, and appropriate intermediate file names must be specified. For example, if the parameter startstep is set to 4, the input file is specified using the 'offsetfile' parameter.

In this example, the user corrects and filters the CAMS displacement files, but does not calculate the offsets or quaternions. To do this the user must specify startstep=1 and stopstep=2. Note that the 'outfile' parameter should be set to "NONE," since this file is not actually written. The 'prefiltfile1' and 'prefiltfile2' must be specified as existing files.

cams2att startstep=1 stopstep=2 infile1="CAMS1.fits" infile2="CAMS2.fits" \
outfile="NONE" instrum=HXI2  prefiltfile1="CAMS1-filt.fits" \
prefiltfile2="CAMS2-filt.fits" clobber=yes

3. In this example, the user calculates the quaternions from a filtered offset file. For this example, the user must specify startstep=5 and stopstep=5.

cams2att startstep=5 stopstep=5 infile1="NONE" infile2="NONE" \
outfile="HXI_delta_att.fits" filtoffset="postfilter_off.fits" \
instrume=HXI1 clobber=yes
4. Run 'cams2att' with the default filtering and GTI expressions. Specify that the attitude is for HXI1. Start with Step 3 and end with Step 5. Also, delete all intermediate files except the one specified as input via the 'offsetfile' parameter. Note that in this example there is only one 'prefiltfile' specified, that for CAMS1. Therefore, the 'filtexpr' and 'gtiexpr0' must reflect that CAMS2 data is bad.

cams2att prefiltfile1="CAMS1-filt.fits" filtexpr="BAD_UNITS==2" 
gtiexpr0="BAD_UNITS==2"\
offsetfile="CAMS_offsets.fits" outfile="HXI1_attitude.fits" \
cams1teldef="CALDB" cams2teldef="CALDB" hxiteldef="CALDB" \
camstempxy="CALDB" instrume="HXI1" startstep=3 \
clobber=yes cleanup=yes infile1="NONE" infile2="NONE"

SEE ALSO

cams2det det2att2 ftcalc ftselect maketime

LAST MODIFIED

February, 2016