Commits

Georg Brandl committed e960759

trisp data: read out logfile values with encoder/target columns

Comments (0)

Files changed (1)

ufit/data/trisp.py

 
 def read_data(filename, fp):
     line = ''
-    xcol = None
     meta = {}
     infofp = open(filename[:-4] + '.log', 'rb')
     # first line in scan info
         if '-----' in line:
             continue
         parts = line.split()
-        if len(parts) != 2:
-            continue
         try:
-            meta[parts[0]] = float(parts[1])
+            if len(parts) == 2:
+                meta[parts[0]] = float(parts[1])
+            elif len(parts) == 3:  # encoder target, value
+                                   # so take value
+                meta[parts[0]] = float(parts[2])
         except ValueError:
             pass
     names = fp.readline().split()