Skip to content

Commit f6ef862

Browse files
committed
fix memmap
1 parent 7d90ba9 commit f6ef862

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

neo/rawio/intanrawio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ def _parse_header(self):
179179
self._raw_data = np.memmap(self.filename, dtype=memmap_data_dtype, mode="r", offset=header_size)
180180

181181
# for 'one-file-per-signal' we have one memory map / neo stream
182+
# based on https://github.com/NeuralEnsemble/python-neo/issues/1556 and the recommendations on the
183+
# Intan website the data appears to be ordered column-major ('F') rather than row-major ('C') so
184+
# when making our memmaps we should do order='F'
182185
elif self.file_format == "one-file-per-signal":
183186
self._raw_data = {}
184187
for stream_index, (stream_index_key, stream_datatype) in enumerate(memmap_data_dtype.items()):
@@ -188,7 +191,7 @@ def _parse_header(self):
188191
dtype_size = np.dtype(stream_datatype).itemsize
189192
n_samples = size_in_bytes // (dtype_size * num_channels)
190193
signal_stream_memmap = np.memmap(
191-
file_path, dtype=stream_datatype, mode="r", shape=(num_channels, n_samples)
194+
file_path, dtype=stream_datatype, mode="r", shape=(num_channels, n_samples), order='F',
192195
).T
193196
self._raw_data[stream_index] = signal_stream_memmap
194197

0 commit comments

Comments
 (0)