Skip to content

Commit 7b1074b

Browse files
committed
use imChan0apGain to set spikeglx imec gain
1 parent 58b4ef7 commit 7b1074b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

neo/rawio/spikeglxrawio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,10 @@ def extract_stream_info(meta_file, meta):
408408
# https://github.com/billkarsh/SpikeGLX/blob/15ec8898e17829f9f08c226bf04f46281f106e5f/Markdown/Metadata_30.md#imec
409409
# We allow also LF streams for NP2.0 because CatGT can produce them
410410
# See: https://github.com/SpikeInterface/spikeinterface/issues/1949
411-
per_channel_gain[:-1] = 1 / 80.
411+
if 'imChan0apGain' in meta:
412+
per_channel_gain[:-1] = 1 / float(meta['imChan0apGain'])
413+
else:
414+
per_channel_gain[:-1] = 1 / 80.
412415
max_int = int(meta['imMaxInt']) if 'imMaxInt' in meta else 8192
413416
gain_factor = float(meta['imAiRangeMax']) / max_int
414417
channel_gains = gain_factor * per_channel_gain * 1e6

0 commit comments

Comments
 (0)