Skip to content

Commit fb14d7b

Browse files
committed
Fix gains for SpikeGLX
1 parent 2e00c99 commit fb14d7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neo/rawio/spikeglxrawio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,15 @@ def scan_files(dirname):
284284
v = meta['imroTbl'][c].split(' ')[index_imroTbl]
285285
per_channel_gain[c] = 1. / float(v)
286286
gain_factor = float(meta['imAiRangeMax']) / 512
287-
channel_gains = per_channel_gain * gain_factor * 1e6
287+
channel_gains = gain_factor / per_channel_gain * 1e6
288288
elif meta['imDatPrb_type'] in ('21', '24') and signal_kind == 'ap':
289289
# This wirk with NP 2.0 case with different metadata versions
290290
# https://github.com/billkarsh/SpikeGLX/blob/gh-pages/Support/Metadata_20.md#channel-entries-by-type
291291
# https://github.com/billkarsh/SpikeGLX/blob/gh-pages/Support/Metadata_20.md#imec
292292
# https://github.com/billkarsh/SpikeGLX/blob/gh-pages/Support/Metadata_30.md#imec
293293
per_channel_gain[:-1] = 80.
294294
gain_factor = float(meta['imAiRangeMax']) / 8192
295-
channel_gains = per_channel_gain * gain_factor * 1e6
295+
channel_gains = gain_factor / per_channel_gain * 1e6
296296
else:
297297
raise NotImplementedError('This meta file version of spikeglx'
298298
'is not implemented')

0 commit comments

Comments
 (0)