Skip to content

Improve digitizers peak finding algorithm

Laurent Mercadier requested to merge improve-peak-finding into master

The peak finding algorithm is improved. It still expect periodic structure in the burst, but works more reliably in general.

Instead of running scipy.signal.find_peaks() directly on an average trace, we first determine the repetition rate (or period) of the peaks by looking at the autocorrelation trace. This allows an accurate determination of the minimum distance between two peaks.

We then use this minimum distance in the find_peaks() function to find the peaks in the average trace. We filter out the peaks that are not equidistant.

Some test were successfully run on data including traces with single PPl pulse, multiple PPL or FEL pulses detected by diodes, APD or MCP, using the Fast ADC or ADQ412, with the following code:

import toolbox_scs as tb
table = [[2711, 310, 'FastADC5raw'], 
         [3078, 12, 'FastADC2_9raw'],
         [2956, 14, 'FastADC2_9raw'],
         [2953, 1, 'FastADC0raw'],
         [2599, 124, 'MCP2raw'],
         [2599, 124, 'FastADC5raw'],
         [2384, 254, 'MCP2raw'],
         [2784, 190, 'MCP4raw'],
        ]
for t in table:
    proposal, runNB, mnemo = t
    print(proposal, runNB)
    run = tb.open_run(proposal, runNB)
    params = tb.check_peak_params(run, mnemo,)
    print(params)
Edited by Laurent Mercadier

Merge request reports