The sm_par structure contains information stored in data file header. It holds some calibration and hardware information (which is less interesting to the end user), but also some scan information like pixel sizes, sample descriptions etc., which are interesting to the end user.
In the following, we describe all the elements in the structure.
If silicon detector channels are recorded, they must be named SIDET01 etc. and must be the first channels in the list (adjacent to each other and in ascending order) to be recognized as silicon detector channels (to be calibrated and combined properly).
The clock and proportional counter channels must be named CLOCK and COUNTER to be recognized properly.
Note that both these arrays have n_adc_channels elements, but only as many are significant as there were ADC channels recorded in that particular scan (starting from the zero element in the order the channels were recorded).
In scans where a stepping motor is the fast axis (due to acceleration and deceleration, the actual dwell time varies), we will record a clock signal as a separate detector channel, and clock_hertz will hold the clock rate (100 kHz or 20 MHz). dwell_msec in that case will hold the desired, but not the actual dwell time.
Example: To correct an
-element data vector from the
crosstalk, you have to use the following IDL code (note the
order of i and j):
out = fltarr(n) ;; initialize
FOR i=0, n-1 DO BEGIN
FOR j=0, n-1 DO BEGIN
out[i] = out[i] + c[j, i] * in[j]
ENDFOR
ENDFOR
where c is the
crosstalk matrix. The
reason why i and j are interchanged as
compared to what you are used to in math is that IDL is a
row-major language, while in common math you treat matrices in
column-major fashion. Read the IDL documentation for details.
If you want to correct only a 1-d data vector, you could more easily use the matrix multiplication operator, but if you want to correct a 3-d data array, you'll have to go with FOR loops.
Holger Fleckenstein 2008-07-08