diff --git a/neo/rawio/spikeglxrawio.py b/neo/rawio/spikeglxrawio.py index 15f969e5d..34e77a6e2 100644 --- a/neo/rawio/spikeglxrawio.py +++ b/neo/rawio/spikeglxrawio.py @@ -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']) + 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'