logic for returning 0 in offset attribute of the electrical series
@@ -166,14 +166,11 @@ class NwbRecordingExtractor(BaseRecording):
self.set_channel_gains(gains)
# Set offsets
- if hasattr(self._es, "offset"):
- offset = self._es.offset * 1e6
- self.set_channel_offsets(offset)
- else:
- if "offset" in self._nwbfile.electrodes:
- offset = self._nwbfile.electrodes["offset"] * 1e6
- self.set_channel_offsets(offset)
+ offset = self._es_offset if hasattr(self._es, "offset") else 0
+ if offset == 0 and "offset" in self._nwbfile.electrodes:
+ offset = self._nwbfile.electrodes["offset"]
+ self.set_channel_offsets(offset * 1e6)
# Add properties
properties = dict()
