fixed a bug in nb_helpers.merge_frames

This commit is contained in:
2024-06-25 13:59:16 +02:00
parent 42e4defcca
commit 4347ba0571
2 changed files with 3 additions and 5 deletions
+1 -3
View File
@@ -249,9 +249,7 @@ class AmorData:
def merge_frames(self):
total_offset = self.tofCut+self.tau*self.config.chopperPhaseOffset/180.
#if nb_helpers:
if False:
# TODO: this routine seems to ignore total_offset
if nb_helpers:
self.tof_e = nb_helpers.merge_frames(self.tof_e, self.tofCut, self.tau, total_offset)
else:
self.tof_e = np.remainder(self.tof_e-(self.tofCut-self.tau), self.tau)+total_offset # tof shifted to 1 frame
+2 -2
View File
@@ -9,7 +9,7 @@ def merge_frames(tof_e, tofCut, tau, total_offset):
dt = (tofCut-tau)
for ti in nb.prange(tof_e.shape[0]):
tof_e_out[ti] = ((tof_e[ti]-dt)%tau)+total_offset # tof shifted to 1 frame
return tof_e
return tof_e_out
@nb.jit(nb.float64[:](nb.float64[:], nb.uint64[:], nb.float64[:]),
nopython=True, parallel=True, cache=True)
@@ -62,4 +62,4 @@ def calculate_derived_properties_focussing(tof_e, detXdist_e, delta_e, mask_e,
mask_e_out[i] = mask_e[i] & ((lmin<=lamda_e[i]) & (lamda_e[i]<=lmax))
alphaF_e[i] = nu-mu+delta_e[i]
qz_e[i] = 4*np.pi*np.sin(np.deg2rad(alphaF_e[i]))/lamda_e[i]
return lamda_e, qz_e, mask_e
return lamda_e, qz_e, mask_e