Skip to content

Commit 58b4ef7

Browse files
committed
Use imMaxInt to calculate spikeglx imec gain factor
1 parent 275e70b commit 58b4ef7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

neo/rawio/spikeglxrawio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ def extract_stream_info(meta_file, meta):
409409
# We allow also LF streams for NP2.0 because CatGT can produce them
410410
# See: https://github.com/SpikeInterface/spikeinterface/issues/1949
411411
per_channel_gain[:-1] = 1 / 80.
412-
gain_factor = float(meta['imAiRangeMax']) / 8192
412+
max_int = int(meta['imMaxInt']) if 'imMaxInt' in meta else 8192
413+
gain_factor = float(meta['imAiRangeMax']) / max_int
413414
channel_gains = gain_factor * per_channel_gain * 1e6
414415
else:
415416
raise NotImplementedError('This meta file version of spikeglx'

0 commit comments

Comments
 (0)