Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #659 from catalystneuro/optional_blackrock_channel…
Browse files Browse the repository at this point in the history
…_unit_value

optional channel unit value
  • Loading branch information
alejoe91 authored Jul 21, 2021
2 parents 2deda6a + 5aa5390 commit 4d6d4f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spikeextractors/extractors/neoextractors/neobaseextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ def __init__(self, block_index=None, seg_index=None, **kargs):
# spikeextractor for units to be uV implicitly
# check that units are V, mV or uV
units = self.neo_reader.header['signal_channels']['units']
assert np.all(np.isin(units, ['V', 'mV', 'uV'])), 'Signal units no Volt compatible'
if not np.all(np.isin(units, ['V', 'mV', 'uV'])):
warnings.warn('Signal units no Volt compatible, assuming scaling as uV')
self.additional_gain = np.ones(units.size, dtype='float')
self.additional_gain[units == 'V'] = 1e6
self.additional_gain[units == 'mV'] = 1e3
self.additional_gain[units == 'uV'] = 1.
self.additional_gain[units == ''] = 1.
self.additional_gain = self.additional_gain.reshape(1, -1)

# Add channels properties
Expand Down

0 comments on commit 4d6d4f4

Please sign in to comment.