Steps to reproduce
import os.path as op
from mne.io import read_raw_fif
base_dir = op.join('/Users/hoechenberger/Development/mne-python/mne', 'io',
'tests', 'data')
raw_ctf_fname = op.join(base_dir, 'test_ctf_raw.fif')
raw = read_raw_fif(raw_ctf_fname, preload=False)
raw.apply_gradient_compensation(3)
raw.copy().pick_types(meg=True).get_data()
Expected results
Opening raw data file /Users/hoechenberger/Development/mne-python/mne/io/tests/data/test_ctf_raw.fif...
Read 5 compensation matrices
Range : 24000 ... 31200 = 10.000 ... 13.000 secs
Ready.
Current compensation grade : 0
Reading 0 ... 7200 = 0.000 ... 3.000 secs...
Compensator constructed to change 0 -> 3
Applying compensator to loaded data
Actual results
Opening raw data file /Users/hoechenberger/Development/mne-python/mne/io/tests/data/test_ctf_raw.fif...
Read 5 compensation matrices
Range : 24000 ... 31200 = 10.000 ... 13.000 secs
Ready.
Current compensation grade : 0
Compensator constructed to change 0 -> 3
Traceback (most recent call last):
File "/private/tmp/mwe.py", line 10, in <module>
raw.copy().pick_types(meg=True).get_data()
File "<decorator-gen-166>", line 21, in get_data
File "/Users/hoechenberger/Development/mne-python/mne/io/base.py", line 823, in get_data
data, times = self[picks, start:stop]
File "/Users/hoechenberger/Development/mne-python/mne/io/base.py", line 772, in __getitem__
data = self._read_segment(start=start, stop=stop, sel=sel,
File "<decorator-gen-163>", line 21, in _read_segment
File "/Users/hoechenberger/Development/mne-python/mne/io/base.py", line 375, in _read_segment
mult = self._comp[idx] * cals
ValueError: operands could not be broadcast together with shapes (304,309) (1,304)
Additional information
If the data is preloaded:
raw = read_raw_fif(raw_ctf_fname, preload=True)
the problem does not occur.
Also if I skip the pick_types() it does work.
NumPy is 1.19.1.
Steps to reproduce
Expected results
Actual results
Additional information
If the data is preloaded:
the problem does not occur.
Also if I skip the
pick_types()it does work.NumPy is 1.19.1.