From 55197974f9334a79d00607af0759233838ca2c82 Mon Sep 17 00:00:00 2001 From: dominikwelke Date: Tue, 1 Apr 2025 18:39:50 +0100 Subject: [PATCH] improve impedance readout --- curryreader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curryreader.py b/curryreader.py index 4752345..b68a789 100644 --- a/curryreader.py +++ b/curryreader.py @@ -195,11 +195,11 @@ def read(inputfilename='', plotdata = 1, verbosity = 2): if tixstart != -1 and tixstop != 1 : text = contents[tixstart:tixstop - 1].split() for imp in text: - if int(imp) != -1: # skip? - impedancelist.append(float(imp)) + impedancelist.append(float(imp) if imp!="-1" else np.nan) # Curry records last 10 impedances impedancematrix = np.asarray(impedancelist, dtype = float).reshape(int(len(impedancelist) / nChannels), nChannels) + impedancematrix = impedancematrix[~np.isnan(impedancematrix).all(axis=1)] if impedancematrix.any(): log.info('Found impedance matrix')