NAME

camssim - Simulates motion of the extended optical bench (EOB) for testing CAMS-correction, and generates RAW coordinates associated with given HXI ACT coordinates and the simulated motion

USAGE

camssim infile1 infile2 outroothxi outrootcams

DESCRIPTION

The camssim task generates a set of sinusoidal motions of the Hitomi EOB for both rotational and translational motions. From these simulated motions, camssim calculates the amount by which each of the two CAMS units moves and optionally, the amount by which an HXI unit moves.

  1. The camssim task generates simulated CAMS output files based on simulated EOB motion. The output files are compatible with all CAMS analysis tools and can be used to study in-flight motion. The camssim task supports three types of statistical errors in the CAMS measurements, but does not simulate CAMS malfunction and always outputs two files with matched time columns and no missing data. Any simulation of missing data (filtering or modifying the file) should be done directly by the user.
  2. The camssim task applies the simulated EOB motion to an HXI event file containing either real or simulated data. The simulated EOB motion, calculated as described below, is applied to the HXI ACTX and ACTY coordinates (no EOB motion) to generate RAWX and RAWY (with EOB motion).

    The motion is simulated as a combination of six sinusoids, two in each perpendicular linear direction (X and Y) and two in rotation (twist). The amplitudes of the six motions can be set independently, and two different frequencies can be set. The linear motions can also be chosen (using the 'typemotion' parameter) to be in phase, 90 degrees out of phase, or 180 degrees out of phase.

    The six independent amplitudes can be set as parameters 'xamp1', 'xamp2', 'yamp1', 'yamp2' (in mm for translation), and 'ramp1', 'ramp2' (in mrad for twist). The two independent frequencies can also be set as parameters 'freq1' and 'freq2'. The output values (in the coordinates of the CAMS units) are 'delta_x', the resulting motion in the X-direction, 'delta_y', the motion in the Y-direction, and 'gamma', the twist angle. Using these definitions, the three possible types of motion are as follows, with time as the independent variable.

    Linear motion: all in phase ('typemotion=1')
    delta_x = xamp1*cos(freq1*time) + xamp2*sin(freq2*time)
    delta_y = yamp1*cos(freq1*time) + yamp2*sin(freq2*time)
    gamma = ramp1*cos(freq1*time) + ramp2*sin(freq2*time)
    Linear motion: X is 180 degrees out of phase with Y and gamma ('typemotion=2')
    delta_x = -xamp1*cos(freq1*time) - xamp2*sin(freq2*time)
    delta_y = yamp1*cos(freq1*time) + yamp2*sin(freq2*time)
    gamma = ramp1*cos(freq1*time) + ramp2*sin(freq2*time)
    Circular motion: X and Y are 90 degrees out of phase ('typemotion=3')
    delta_x = xamp1*cos(freq1*time) + xamp2*cos(freq2*time)
    delta_y = yamp1*sin(freq1*time) + yamp2*sin(freq2*time)
    gamma = ramp1*cos(freq1*time) + ramp2*sin(freq2*time)

    It is also possible to add random error to the simulated CAMS measurements. Calling "randn" a normally-distributed random number and "freqerr" the frequency of the time-dependent part, and using the three input parameters 'randerr', 'sinerr', and 'consterr', representing respectively the amplitudes of a random error, a time-varying error, and a constant error. The errors are derived as:

    error_x1 = randerr*randn + consterr*sin(freqerr*time) + sinerr
    error_y1 = randerr*randn + sinerr*sin(freqerr*time) + consterr
    error_x2 = randerr*randn + sinerr*sin(freqerr*time) + consterr
    error_y2 = randerr*randn + sinerr*sin(freqerr*time) + consterr
    The errors are applied to the output CAMS X/Y positions (delta_x, delta_y), but not to the rotation angle.

PARAMETERS

infile1 = hxi1.evt [filename NONE|file name]
Input HXI1 event file with ACTX and ACTY coordinate columns to be converted to RAWX and RAWY by applying the simulated motion. Set to NONE if this output is not required.

infile2 = hxi2.evt [filename NONE|file name]
Input HXI2 event file with ACTX and ACTY coordinate columns to be converted to RAWX and RAWY by applying the simulated motion. Set to NONE if this output is not required.

outroothxi = outputhxi [string]
Root name of the output HXI file(s). The output file name is 'outroothxi'-n.fits, where n is either 1 or 2. If both 'infile1' and 'infile2' are given as valid files, there are two output HXI files with suffixes n = 1 and n = 2, providing the output corresponding to 'infile1' and 'infile2', respectively. If only one of 'infile1' or 'infile2' is given as a valid file, there is only one output file corresponding to whichever input file is given.

outrootcams = outputcams [string]
Root name of the output CAMS files. The output file names are outrootcams-1.fits for CAMS1 and outrootcams-2.fits for CAMS2.

(hxiteldef1 = CALDB) [filename CALDB|file name]
Name of the HXI1 teldef file. If the parameter is set to CALDB, the file is read from a the calibration database.

(hxiteldef2 = CALDB) [filename CALDB|file name]
Name of the HXI2 teldef file. If the parameter is set to CALDB, the file is read from the calibration database.

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

(freq1 = 1.0) [double]
Frequency [Hz] of the 1st sinusoid in the simulated motion.

(freq2 = 1.0) [double]
Frequency [Hz] of the 2nd sinusoid in the simulated motion.

(xamp1 = 1.0) [double]
Amplitude [mm] of the X-motion (translation) for 1st sinusoid.

(xamp2 = 1.0) [double]
Amplitude [mm] of the X-motion (translation) for 2nd sinusoid.

(yamp1 = 1.0) [double]
Amplitude [mm] of the Y-motion (translation) for 1st sinusoid.

(yamp2 = 1.0) [double]
Amplitude [mm] of the Y-motion (translation) for 2nd sinusoid.

(ramp1 = 0.0) [double]
Amplitude [mrad] of the twist motion for 1st sinusoid.

(ramp2 = 0.0) [double]
Amplitude [mrad] of the twist motion for 2nd sinusoid.

(typemotion = 1) [integer 1|2|3]
Type of motion 1 = X,Y in phase, 2 = X,Y out of phase, 3 = X,Y 90 degrees out of phase.

(deltatcams = 1.0) [double]
Time interval [s] in which the CAMS records five measurements.

(randerr = 0.240) [double]
Magnitude of CAMS error: random component [mm].

(consterr = 0.0) [double]
Magnitude of CAMS error: constant component [mm].

(sinerr = 0.0)[double]
Magnitude of CAMS error: sinusoidal component [mm].

(freqerr = 0.0) [double]
Frequency [Hz] of the sinusoidal error component.

(seed = 0) [integer]
Random number generator seed. If 'seed=0' the system is used.

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

(clobber = no) [boolean]
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]
Diagnostic output is printed to the screen if set to yes.

(history = yes) [boolean]
Records tool parameters in HISTORY.

EXAMPLES

  1. Generate HXI1 and HXI2 files from input event files, using default parameters.
  2.    camssim infile1=hxi1_events.fits infile2=hxi2_events.fits outroothxi=outputhxi outrootcams=utputcams clobber=yes
    
  3. Generate HXI1 files from input event files, no twist motion, and user-supplied amplitudes and frequencies. The X and Y motions are to be 90 degrees out of phase.
  4.    camssim infile1=hxi1_events.fits infile2=hxi2_events.fits outroothxi=outputhxi outrootcams=outputcams freq1=10.0 \
          freq2=0.5 xamp1=2.5 xamp2=3.6 yamp1=1.5 yamp2=2.1 ramp1=0.0 ramp2=0.0 typemotion=3 clobber=yes
    
  5. Generate HXI1 files from input event files, with the same parameters as in the second example above, but include user-supplied CAMS error parameters.
  6.    camssim infile1=hxi1_events.fits infile2=hxi2_events.fits outroothxi=outputhxi outrootcams=outputcams freq1=10.0 \
          freq2=0.5 xamp1=2.5 xamp2=3.6 yamp1=1.5 yamp2=2.1 ramp1=0.0 ramp2=0.0 typemotion=3 clobber=yes randerr=0.5 consterr=0.1 \
          sinerr=0.95 freqerr=60.0
    

SEE ALSO

cams2det, cams2att

LAST MODIFIED

November 30, 2018