Skip to content

Commit 479c86f

Browse files
authored
Merge pull request #1310 from hornauerp/master
Fixed bug in maxwellrawio.py that shuffled channels
2 parents 972901f + d97fe0c commit 479c86f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

neo/rawio/maxwellrawio.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop,
183183
if np.array(channel_indexes).size > 1 and np.any(np.diff(channel_indexes) < 0):
184184
# get around h5py constraint that it does not allow datasets
185185
# to be indexed out of order
186-
sorted_channel_indexes = np.sort(channel_indexes)
187-
resorted_indexes = np.array(
188-
[list(channel_indexes).index(ch) for ch in sorted_channel_indexes])
186+
order_f = np.argsort(channel_indexes)
187+
sorted_channel_indexes = channel_indexes[order_f]
188+
# use argsort again on order_f to obtain resorted_indexes
189+
resorted_indexes = np.argsort(order_f)
189190

190191
try:
191192
if resorted_indexes is None:

0 commit comments

Comments
 (0)