fixed a bug in nb_helpers.merge_frames
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user