From 9eaa6b24d596f6146d12e3cc0f34c2ce327d9938 Mon Sep 17 00:00:00 2001
From: Laurent Mercadier <laurent.mercadier@xfel.eu>
Date: Sat, 26 Oct 2019 08:24:15 +0200
Subject: [PATCH] Cleaned up

---
 xgm.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/xgm.py b/xgm.py
index 506bfcc..881b8bd 100644
--- a/xgm.py
+++ b/xgm.py
@@ -609,12 +609,10 @@ def getTIMapd(data, mcp=1, use_apd=True, intstart=None, intstop=None,
                             'SCS_UTC1_ADQ/ADC/1', 'board1.apd.channel_0.upperLimit.value')[0].values
             period = upperLimit - initialDelay #period of the apd in number of digitizer samples
             idx /= int(period/440) #440 samples correspond to the separation between two pulses at 4.5 MHz
-            if len(idx)==1:
-                idx = idx[0].astype(int)
-                tim = apd.isel(apdId=idx)
-                return tim
+            idx = idx[0].astype(int)
+            return apd.isel(apdId=idx)
         else:
-            apd = mcpPeaks(data, intstart, intstop, bkgstart, bkgstop, mcp=mcp, 
+            return mcpPeaks(data, intstart, intstop, bkgstart, bkgstop, mcp=mcp, 
                            t_offset=t_offset, npulses=maxpulses)
     
     #2. case where the number of SASE 3 pulses varied during the run:
-- 
GitLab