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

Plot 2nd and 2nd to last peaks in check_peak_params

parent d890c4df
No related branches found
No related tags found
1 merge request!312Extract peaks
Pipeline #164047 failed
...@@ -663,15 +663,20 @@ def plotPeakIntegrationWindow(raw_trace, params, show_all=False): ...@@ -663,15 +663,20 @@ def plotPeakIntegrationWindow(raw_trace, params, show_all=False):
fig, ax = plt.subplots(1, 2, figsize=(6, 3), constrained_layout=True) fig, ax = plt.subplots(1, 2, figsize=(6, 3), constrained_layout=True)
for plot in range(2): for plot in range(2):
title = 'First pulse' if plot == 0 else 'Last pulse' title = 'First pulse' if plot == 0 else 'Last pulse'
i = 0 if plot == 0 else -1 i = 0 if plot == 0 else - 1
ax[plot].axvline(baseStarts[i], ls='--', color='k') for j in range(min(2, len(starts))):
ax[plot].axvline(baseStops[i], ls='--', color='k') if plot == 1:
ax[plot].axvspan(baseStarts[i], baseStops[i], j = -j
alpha=0.5, color='grey', label='baseline') label='baseline' if j == 0 else ''
ax[plot].axvline(starts[i], ls='--', color='r') ax[plot].axvline(baseStarts[i+j], ls='--', color='k')
ax[plot].axvline(stops[i], ls='--', color='r') ax[plot].axvline(baseStops[i+j], ls='--', color='k')
ax[plot].axvspan(starts[i], stops[i], ax[plot].axvspan(baseStarts[i+j], baseStops[i+j],
alpha=0.2, color='r', label='peak') alpha=0.5, color='grey', label=label)
label='peak' if j == 0 else ''
ax[plot].axvline(starts[i+j], ls='--', color='r')
ax[plot].axvline(stops[i+j], ls='--', color='r')
ax[plot].axvspan(starts[i+j], stops[i+j],
alpha=0.2, color='r', label=label)
if len(starts) > 1: if len(starts) > 1:
period = starts[1] - starts[0] period = starts[1] - starts[0]
xmin = np.max([0, baseStarts[i] - int(1.5*period)]) xmin = np.max([0, baseStarts[i] - int(1.5*period)])
......
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