Skip to content

Commit d47de11

Browse files
Merge pull request #1095 from samuelgarcia/fix_openephys_legacy
Fix OpenEphys bug stream ids #1055
2 parents 7ae1a2f + 81466f2 commit d47de11

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

neo/rawio/openephysrawio.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ def _parse_header(self):
120120

121121
if seg_index == 0:
122122
# add in channel list
123+
if ch_name[:2].upper() == 'CH':
124+
units = 'uV'
125+
else:
126+
units = 'V'
123127
signal_channels.append((ch_name, chan_id, chan_info['sampleRate'],
124-
'int16', 'V', chan_info['bitVolts'], 0., processor_id))
128+
'int16', units, chan_info['bitVolts'], 0., processor_id))
125129

126130
# In some cases, continuous do not have the same lentgh because
127131
# one record block is missing when the "OE GUI is freezing"
@@ -173,7 +177,7 @@ def _parse_header(self):
173177

174178
# and create streams channels (keep natural order 'CH' first)
175179
stream_ids, order = np.unique(chan_stream_ids, return_index=True)
176-
stream_ids = stream_ids[order]
180+
stream_ids = stream_ids[np.argsort(order)]
177181
signal_streams = [(f'Signals {stream_id}', f'{stream_id}') for stream_id in stream_ids]
178182
signal_streams = np.array(signal_streams, dtype=_signal_stream_dtype)
179183

0 commit comments

Comments
 (0)