From b72f63ac72017d87c3bc475393d9ed86f264ce5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20WYNGAARD?= Date: Tue, 9 Apr 2024 12:11:54 +0200 Subject: [PATCH] Correct gain in output with float recording Right now there is a problem, where a non-one gain with a flaot recording will output a different gain than the one used, So when loading with SpikeInterface, the traces are wrongly scaled. --- src/MEArec/generators/recordinggenerator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MEArec/generators/recordinggenerator.py b/src/MEArec/generators/recordinggenerator.py index aaedc8b..02d091f 100644 --- a/src/MEArec/generators/recordinggenerator.py +++ b/src/MEArec/generators/recordinggenerator.py @@ -729,6 +729,8 @@ def generate_recordings( gain = 1.0 / gain_to_int else: gain_to_int = 1.0 / gain + else: + gain = 1.0 # Necessary to output the correct gain used else: if tempgen is not None: if celltype_params is not None: @@ -867,6 +869,8 @@ def generate_recordings( gain = 1.0 / gain_to_int else: gain_to_int = 1.0 / gain + else: + gain = 1.0 # Necessary to output the correct gain used if gain_to_int is not None: if verbose_1: