NAME
cams2att - Computes a time-dependent delta-attitude file for Hitomi HXI
USAGE
cams2att infile1 infile2 outfile instrume
DESCRIPTION
The cams2att task 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 (which have the wobble removed) given
the RAW coordinates (which are subject to the wobble). The cams2att task is instrument-specific
and must be run separately
on each of the two HXI units, HXI1 and HXI2.
The cams2att task 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 into the X
and Y columns
of 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.
The cams2det parameter
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 (GTI) file using maketime.
Step 5. Run det2att2 to convert the offsets and rotations in HXI
coordinate space
into quaternions.
PARAMETERS
- infile1 = cams1_data.fits [string]
- Name of input
FITS file containing the X and Y positions determined by the CAMS1 system.
- infile2 = cams2_data.fits [string]
- Name of input
FITS file containing the X and Y positions determined by the CAMS2 system.
- outfile = deltaq.fits [filename]
- 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) [filename CALDB|file name]
- Name of the CAMS1 teldef file. If the parameter is set to CALDB,
the file is read from the calibration database.
- (cams2teldef = CALDB) [filename CALDB|file name]
- Name of the CAMS2 teldef file. If the parameter is set to CALDB,
the file is read from the calibration database.
- (hxiteldef = CALDB) [filename CALDB|file name]
- 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) [filename CALDB|file name]
-
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 1|2|3|4|5]
-
The beginning step for processing within cams2att. The five processing steps
are
listed in the description above.
- (stopstep = 5) [integer 1|2|3|4|5]
-
The final step for processing within cams2att. The five processing steps are
listed in
the description above.
- (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 yes|no]
- 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 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 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
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 '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 RAW|FOC]
- Origin coordinate system for transformation done by det2att2.
- (deltaxcol = DELTARAWX) [string]
- Column name for the change in the X-coordinate in 'filtoffset' read by
det2att2 in Step 5.
- (deltaycol = DELTARAWY) [string]
- Column name for the change in the Y-coordinate in 'filtoffset' read by
det2att2 in Step 5.
- (sincol = SINANGLE) [string]
- Column name for sine of rotation angle in 'filtoffset' read by
det2att2 in Step 5.
- (coscol = COSANGLE) [string]
- Column name for cosine of rotation angle in 'filtoffset' read by
det2att2 in Step 5.
- (cleanup = yes) [boolean yes|no]
- Delete temporary files if 'cleanup=yes'.
- (buffer = -1) [integer -1|0|N]
- Rows to buffer (-1=auto, 0=none, N>0=numrows).
- (clobber = no) [boolean yes|no]
- Overwrites the existing output file if set to yes.
- (chatter = 1) [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 tool parameters in HISTORY.
EXAMPLES
- 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"
- The cams2att task 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 file names 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 parameter '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: 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
- 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
- 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: in this example
only 'prefiltfile1' for CAMS1 is specified.
Therefore, '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
March 11, 2020