Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gain calculation for Neuropixel 2.0 might be wrong #1363

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions neo/rawio/spikeglxrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,12 @@ def extract_stream_info(meta_file, meta):
# https://github.com/billkarsh/SpikeGLX/blob/15ec8898e17829f9f08c226bf04f46281f106e5f/Markdown/Metadata_30.md#imec
# We allow also LF streams for NP2.0 because CatGT can produce them
# See: https://github.com/SpikeInterface/spikeinterface/issues/1949
per_channel_gain[:-1] = 1 / 80.
gain_factor = float(meta['imAiRangeMax']) / 8192
if 'imChan0apGain' in meta:
per_channel_gain[:-1] = 1 / float(meta['imChan0apGain'])
alejoe91 marked this conversation as resolved.
Show resolved Hide resolved
else:
per_channel_gain[:-1] = 1 / 80.
max_int = int(meta['imMaxInt']) if 'imMaxInt' in meta else 8192
gain_factor = float(meta['imAiRangeMax']) / max_int
channel_gains = gain_factor * per_channel_gain * 1e6
else:
raise NotImplementedError('This meta file version of spikeglx'
Expand Down