Skip to content

Commit bc786b0

Browse files
authored
improve impedance readout (#2)
1 parent 6ba6757 commit bc786b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

curryreader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ def read(inputfilename='', plotdata = 1, verbosity = 2):
206206
if tixstart != -1 and tixstop != 1 :
207207
text = contents[tixstart:tixstop - 1].split()
208208
for imp in text:
209-
if int(imp) != -1: # skip?
210-
impedancelist.append(float(imp))
209+
impedancelist.append(float(imp) if imp!="-1" else np.nan)
211210

212211
# Curry records last 10 impedances
213212
impedancematrix = np.asarray(impedancelist, dtype = float).reshape(int(len(impedancelist) / nChannels), nChannels)
213+
impedancematrix = impedancematrix[~np.isnan(impedancematrix).all(axis=1)]
214214

215215
if impedancematrix.any():
216216
log.info('Found impedance matrix')

0 commit comments

Comments
 (0)