Skip to content

Commit e8da1f5

Browse files
author
Simon Danner
committed
fixed error when reading RealWave Spike2 channels and unrecongized quantities
1 parent 8375fcf commit e8da1f5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

neo/io/proxyobjects.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
Epoch, Event, SpikeTrain)
2121
from neo.core.dataobject import ArrayDict
2222

23+
import logging
2324

2425
class BaseProxy(BaseNeo):
2526
def __init__(self, array_annotations=None, **annotations):
@@ -115,7 +116,9 @@ def __init__(self, rawio=None, global_channel_indexes=None, block_index=0, seg_i
115116
np.all(sig_chans['offset'] == 0.)
116117

117118
if support_raw_magnitude:
119+
sig_chans['units'][0]
118120
str_units = ensure_signal_units(sig_chans['units'][0]).units.dimensionality.string
121+
119122
self._raw_units = pq.CompoundUnit('{}*{}'.format(sig_chans['gain'][0], str_units))
120123
else:
121124
self._raw_units = None
@@ -522,6 +525,7 @@ def ensure_signal_units(units):
522525
logging.warning('Units "{}" can not be converted to a quantity. Using dimensionless '
523526
'instead'.format(units))
524527
units = ''
528+
units = pq.Quantity(1, units)
525529
return units
526530

527531

neo/rawio/spike2rawio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def _parse_header(self):
215215
elif chan_info['kind'] == 9: # float32
216216
gain = 1.
217217
offset = 0.
218-
sig_dtype = 'int32'
218+
sig_dtype = 'float32'
219219
group_id = 0
220220
sig_channels.append((name, chan_id, sampling_rate, sig_dtype,
221221
units, gain, offset, group_id))

0 commit comments

Comments
 (0)