Update TTCF diagonal
The new reference code does the following operation on the main diagonal:
for i in range(1,ltimes): # was ltimes-1, so res[-1] was always 1 !
dia_n = np.diag(num, k=i)
dia_d = np.diag(denom, k=i)
res[i-1] = np.sum(dia_n) / np.sum(dia_d)
if calc_std:
dev[i-1] = np.std(dia_n / dia_d) / np.sqrt(len(dia_d))
if ttcf_par>0:
trc = num/denom
if TINKER_DIAGONAL:
tmp = np.diag(trc,k=1)
tmp = np.mean(tmp[tmp>0])
for j in range(ltimes):
trc[j,j]=tmp
del tmp
This MR adds the "diagonal tinkering" to MatMulCorrelator
and EventMatrixCorrelator
.
Caveats:
- This is a post-processing step done in numpy. OpenCL implementation will take more time to do.
- This will have to be done in Fourier-based correlators