From a5189537bb3197ebf555a39dc7012bf25711f3be Mon Sep 17 00:00:00 2001 From: Philipp Dijkstal Date: Sun, 27 Apr 2025 12:01:58 +0200 Subject: [PATCH 1/2] bugfix --- ext/bscacquisition.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/bscacquisition.py b/ext/bscacquisition.py index 28efa25..da3ad3a 100644 --- a/ext/bscacquisition.py +++ b/ext/bscacquisition.py @@ -25,12 +25,13 @@ class BSCAcquisition(Acquisition): #print('Received %i' % i) # write out the data file + use_channels = channels or self.bscache.channels with h5py.File(filename,'a') as hid: # save the pulse ID singledata = [ele['pid'] for ele in data] pidname = 'pulse_id/group%d' % self.grp hid.create_dataset(pidname, data=singledata) - for chn in channels: + for chn in use_channels: singledata = [ele[chn] for ele in data] if not chn == 'pid': dname = chn.replace(':','/')+'/data' -- 2.49.1 From 1d933a66ceba666186696b32267ce3bc29f4174c Mon Sep 17 00:00:00 2001 From: Philipp Dijkstal Date: Sun, 27 Apr 2025 12:33:56 +0200 Subject: [PATCH 2/2] change argument passed to baseclass Acquisition --- ext/bscacquisition.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/bscacquisition.py b/ext/bscacquisition.py index da3ad3a..5c789d8 100644 --- a/ext/bscacquisition.py +++ b/ext/bscacquisition.py @@ -8,10 +8,11 @@ from slic.core.acquisition.acquisition import Acquisition class BSCAcquisition(Acquisition): - def __init__(self, bscache, *args, **kwargs): + def __init__(self, bscache, *args, use_channels=None, **kwargs): self.bscache = bscache + self.use_channels = use_channels self.grp = 0 - super().__init__(*args, **kwargs) + super().__init__(*args, default_channels=bscache.channels.keys(), **kwargs) def setGroup(self,idx): self.grp = idx @@ -25,7 +26,7 @@ class BSCAcquisition(Acquisition): #print('Received %i' % i) # write out the data file - use_channels = channels or self.bscache.channels + use_channels = self.use_channels or self.bscache.channels.keys() with h5py.File(filename,'a') as hid: # save the pulse ID singledata = [ele['pid'] for ele in data] -- 2.49.1