diff --git a/src/toolbox_scs/routines/boz.py b/src/toolbox_scs/routines/boz.py index 61c1fbd13fd18fa6e0fd29da0a73cb63c8196f26..4f1110f37344d6417b02595544a722cb4077ccd0 100644 --- a/src/toolbox_scs/routines/boz.py +++ b/src/toolbox_scs/routines/boz.py @@ -346,9 +346,9 @@ def find_rois(data_mean, threshold): rois: dictionnary of rois """ # compute vertical and horizontal projection - pX = data_mean.sum(axis=0) + pX = data_mean.mean(axis=0) pX = pX[:256] # half the ladder since there is a gap in the middle - pY = data_mean.sum(axis=1) + pY = data_mean.mean(axis=1) # along X lowX = int(np.argmax(pX[:64] > threshold)) # 1st occurrence returned @@ -438,9 +438,9 @@ def inspect_rois(data_mean, rois, threshold=None, allrois=False): matplotlib figure """ # compute vertical and horizontal projection - pX = data_mean.sum(axis=0) + pX = data_mean.mean(axis=0) pX = pX[:256] # half the ladder since there is a gap in the middle - pY = data_mean.sum(axis=1) + pY = data_mean.mean(axis=1) # Set up the axes with gridspec fig = plt.figure(figsize=(5, 3)) @@ -605,6 +605,8 @@ def load_dssc_module(proposalNB, runNB, moduleNB=15, arr[arr == 0] = 256 ppt = run[source, key][subset].data_counts() + # ignore train with no pulses, can happen in burst mode acquisition + ppt = ppt[ppt > 0] tid = ppt.index.to_numpy() ppt = np.unique(ppt)