From 4e6bba9d0b150bc960fd4b587a086aa5b85b1032 Mon Sep 17 00:00:00 2001 From: Alexandre Gramfort Date: Tue, 9 Aug 2022 15:11:47 +0200 Subject: [PATCH] WIP : attempt to use units from channels.tsv --- mne_bids/read.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mne_bids/read.py b/mne_bids/read.py index f653dcdf3..f5ebfab48 100644 --- a/mne_bids/read.py +++ b/mne_bids/read.py @@ -577,6 +577,13 @@ def _handle_channels_reading(channels_fname, raw): raw.info['bads'] = bads_avail + if 'units' in channels_dict: + for k, (ch_type, ch_unit) in enumerate(zip( + channels_dict['type'], + channels_dict['units'])): + scaling = mne.io.base._get_scaling(ch_type.lower(), ch_unit) + raw._raw_extras[0]['units'][k] /= scaling + return raw