From 13d4db25fa2ee3cb58af71debea2c38eaa91f533 Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Fri, 27 Sep 2024 20:04:05 +0200 Subject: [PATCH] adding sampled dimensions for nix data arrays --- pyrelacs/repros/calbi.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pyrelacs/repros/calbi.py b/pyrelacs/repros/calbi.py index 6c74f13..f03b934 100644 --- a/pyrelacs/repros/calbi.py +++ b/pyrelacs/repros/calbi.py @@ -132,15 +132,20 @@ class Calibration(MccDac): channel1 = np.array(readout[::2]) channel2 = np.array(readout[1::2]) - block.create_data_array( + stim_data = block.create_data_array( f"stimulus_{db_value}", - "Array", + "nix.regular_sampled", shape=data.shape, data=channel1, label="Voltage", unit="V", ) - block.create_data_array( + stim_data.append_sampled_dimension( + self.SAMPLERATE, + label="time", + unit="s", + ) + fish_data = block.create_data_array( f"fish_{db_value}", "Array", shape=data.shape, @@ -148,6 +153,11 @@ class Calibration(MccDac): label="Voltage", unit="V", ) + fish_data.append_sampled_dimension( + self.SAMPLERATE, + label="time", + unit="s", + ) beat = channel1 + channel2 beat_square = beat**2