From 4ba61aa5d8e31bedc7c871c4466274d97b6d3eeb Mon Sep 17 00:00:00 2001 From: bcolsen Date: Tue, 9 Apr 2019 17:23:16 -0600 Subject: [PATCH 1/2] added parsing of loop_modules --- galvani/BioLogic.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/galvani/BioLogic.py b/galvani/BioLogic.py index c68769c..2c2c413 100644 --- a/galvani/BioLogic.py +++ b/galvani/BioLogic.py @@ -325,6 +325,7 @@ class MPRfile: self.modules = modules settings_mod, = (m for m in modules if m['shortname'] == b'VMP Set ') data_module, = (m for m in modules if m['shortname'] == b'VMP data ') + maybe_loop_module = [m for m in modules if m['shortname'] == b'VMP loop '] maybe_log_module = [m for m in modules if m['shortname'] == b'VMP LOG '] n_data_points = np.frombuffer(data_module['data'][:4], dtype=' Date: Thu, 11 Apr 2019 17:30:05 -0600 Subject: [PATCH 2/2] Default loop to none and trim the trailing zeros --- galvani/BioLogic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/galvani/BioLogic.py b/galvani/BioLogic.py index 2c2c413..78229d7 100644 --- a/galvani/BioLogic.py +++ b/galvani/BioLogic.py @@ -311,6 +311,7 @@ class MPRfile: """ def __init__(self, file_or_path): + self.loop_index = None if isinstance(file_or_path, str): mpr_file = open(file_or_path, 'rb') else: @@ -372,6 +373,7 @@ class MPRfile: if loop_module['version'] == 0: self.loop_index = np.fromstring(loop_module['data'][4:], dtype='