Skip to content
Snippets Groups Projects
Commit 88bd7df7 authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

Find trace using threshold value instead of pulse pattern

parent a429b230
No related branches found
No related tags found
1 merge request!67Auto fast adc
...@@ -882,7 +882,8 @@ def autoFindFastAdcPeaks(data, channel=5, threshold=35000, display=False, plot=F ...@@ -882,7 +882,8 @@ def autoFindFastAdcPeaks(data, channel=5, threshold=35000, display=False, plot=F
key = f'FastADC{channel}raw' key = f'FastADC{channel}raw'
if key not in data: if key not in data:
raise ValueError(f'{key} not found in data set') raise ValueError(f'{key} not found in data set')
trace = data[key].where(data['npulses_sase3']>0, drop=True).isel(trainId=0).values tid = data[key].where(data[key]>threshold, drop=True).trainId[0]
trace = data[key].sel(trainId=tid)
centers, peaks = find_peaks(trace, height=threshold, width=(4, None)) centers, peaks = find_peaks(trace, height=threshold, width=(4, None))
c = centers[0] c = centers[0]
w = np.average(peaks['widths']).astype(int) w = np.average(peaks['widths']).astype(int)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment