Skip to content

Commit f03780c

Browse files
committed
add access to digital-in and digital-out
1 parent ae54d92 commit f03780c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

neo/rawio/intanbinaryrawio.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,23 @@ def read_rhd(filename):
351351
chan_info['gain'] = 0.0003125
352352
chan_info['offset'] = -32768 * 0.0003125
353353
ordered_channels.append(chan_info)
354-
data_dtype[3]+= [(name,'uint16', BLOCK_SIZE)]
354+
data_dtype[3] += [(name,'uint16', BLOCK_SIZE)]
355355

356356
# 4: USB board digital input channel stored in digitalin.dat/board-DIGITAL-IN-*
357357
# 5: USB board digital output channel stored in digitalout.dat/board-DIGITAL-OUT-*
358358
for sig_type in [4, 5]:
359-
# at the moment theses channel are not in sig channel list
360-
# but they are in the raw memamp
359+
# User can obtain digital channels from analog_signal_chunk and then process
360+
# them themself
361361
if len(channels_by_type[sig_type]) > 0:
362362
name = {4: 'DIGITAL-IN', 5: 'DIGITAL-OUT'}[sig_type]
363-
data_dtype[sig_type] += [(name,'uint16', BLOCK_SIZE)]
363+
chan_info = channels_by_type[sig_type][0]
364+
chan_info['native_channel_name'] = name # overwite to allow memmap to work
365+
chan_info['sampling_rate'] = sr
366+
chan_info['units'] = 'TTL' # arbitrary units so I did TTL for the logic
367+
chan_info['gain'] = 1.0
368+
chan_info['offset'] = 0.0
369+
ordered_channels.append(chan_info)
370+
data_dtype[sig_type] += [(name, 'uint16', BLOCK_SIZE)]
364371

365372
if bool(global_info['notch_filter_mode']) and version >= V('3.0'):
366373
global_info['notch_filter_applied'] = True

0 commit comments

Comments
 (0)