TTCF rebinning
Add a rebinning utility to TTCF classes.
To do:
-
Put in place the interface for MatrixEventCorrelator
classes -
Implement binning in matrix_evtcorrelator.cl
and inutils.cl
-
Check that results are the same for binning=1
-
Add unit test
-
-
Implement binning in matrix_evtcorrelator_time.cl
-
Check that results are the same for binning=1
-
Add unit test
-
About
The (numerator) TTCF result for time pair (t_1, t_2)
is \text{TTCF}(t_1, t_2) = \displaystyle\sum_p I(t_1, p) I(t_2, p)
.
The most intuitive way of storing the TTCF result is to use cartesian coordinates (t_1, t_2)
.
Matrix (2D array) is the natural data structure mapping a pair of time indices (t_1, t_2)
to the \text{TTCF}(t_1, t_2)
.
corr_matrix_num[t1, t2] = sum_p{I(t1, p) I(t2, p)}
It can easily be extended to three dimensions to account for the scattering vector index qbin
(0, 1, 2, ...):
corr_matrix_num_3D[qbin, t1, t2] = sum_p{I(t1, p) I(t2, p)}`
Each correlation matrix has normally a shape (n_frames, n_frames)
.
In the case of TTCF, the matrix is symmetric (as I(t_1) I(t_2) = I(t_2) I(t_1)
).
For large number of frames, it makes sense to use another data structure which avoids this redundancy.
In the correlator software, TTCF is by default stored in what is called a flattened matrix. This is a one-dimensional array, where
- The first
n_frames
items correspond to first line 0 of correlation matrix - The next
n_frames - 1
items correspond to the second line of correlation matrix - and so on
Rebinning can be done with a coordinate change:
\text{TTCF}[\vec{\rho}(t_1, t_2)] = \ldots
\vec{\rho}(t_1, t_2) = (\frac{t_1}{b}, t_1, t_2)
where b
is the (integer) binning factor.