Skip to content

Commit d029743

Browse files
committed
explicitly cast memamp to int16
1 parent cc1955c commit d029743

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/trodes_to_nwb/spike_gadgets_raw_io.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,9 @@ def get_analogsignal_multiplexed(self, channel_names=None) -> np.ndarray:
560560
)
561561
# read the data into int16
562562
data = (
563-
self._raw_memmap[:, data_offsets[:, 0]]
564-
+ self._raw_memmap[:, data_offsets[:, 0] + 1] * INT_16_CONVERSION
563+
self._raw_memmap[:, data_offsets[:, 0]].astype(np.int16)
564+
+ self._raw_memmap[:, data_offsets[:, 0] + 1].astype(np.int16)
565+
* INT_16_CONVERSION
565566
)
566567
# initialize the first row
567568
analog_multiplexed_data[0] = data[0]
@@ -646,8 +647,8 @@ def get_analogsignal_multiplexed_partial(
646647
)
647648
# read the data into int16
648649
data = (
649-
self._raw_memmap[i_start:i_stop, data_offsets[:, 0]]
650-
+ self._raw_memmap[i_start:i_stop, data_offsets[:, 0] + 1]
650+
self._raw_memmap[i_start:i_stop, data_offsets[:, 0]].astype(np.int16)
651+
+ self._raw_memmap[i_start:i_stop, data_offsets[:, 0] + 1].astype(np.int16)
651652
* INT_16_CONVERSION
652653
)
653654
# initialize the first row
@@ -969,8 +970,9 @@ def get_analogsignal_multiplexed(self, channel_names=None) -> np.ndarray:
969970
)
970971
# read the data into int16
971972
data = (
972-
self._raw_memmap[:, data_offsets[:, 0]]
973-
+ self._raw_memmap[:, data_offsets[:, 0] + 1] * INT_16_CONVERSION
973+
self._raw_memmap[:, data_offsets[:, 0]].astype(np.int16)
974+
+ self._raw_memmap[:, data_offsets[:, 0] + 1].astype(np.int16)
975+
* INT_16_CONVERSION
974976
)
975977
# initialize the first row
976978
# if no previous state, assume first segment. Default to superclass behavior

0 commit comments

Comments
 (0)