From 279510978c7cb0ba7ac3ebde7af76f2b1ba27ac4 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Mon, 18 Dec 2023 11:52:54 +0100 Subject: [PATCH] pass other tests --- src/pynwb/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pynwb/base.py b/src/pynwb/base.py index 2ad38edd5..6f051befa 100644 --- a/src/pynwb/base.py +++ b/src/pynwb/base.py @@ -296,7 +296,11 @@ def get_timestamps(self): return np.arange(len(self.data)) / self.rate + self.starting_time def get_data_in_units(self): - return np.asarray(self.data) * self.conversion * self.channel_conversion[:, np.newaxis] + self.offset + if "channel_conversion" in self.fields: + scale_factor = self.conversion * self.channel_conversion[:, np.newaxis] + else: + scale_factor = self.conversion + return np.asarray(self.data) * scale_factor + self.offset @register_class('Image', CORE_NAMESPACE)