evoked.plot_topomap help

External Email - Use Caution

Hello everyone;

I am trying to use the topomap plot, but I am having some issues (script below)

I guess the problem is that I am trying to load the sensor location from the initial fif file but then using it as montage info on a .mat file epochs loaded.

the error I get is:

ValueError: Cannot determine location of MEG/EOG/ECG channels using digitization points.

Any help?

import os.path as op
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.io import loadmat
import mne

data_path = op.join("exocos", "MEG", "sample", "s1")

fif = data_path + '/run01_sss.fif'
tmin = -.500

Montage = mne.channels.read_dig_montage(fif=fif)
print(Montage) #here everything looks good

info = mne.create_info(102, sfreq=500, ch_types='mag', montage=Montage)
print(info) #here I want to select only 102 MAG channel from the list of 339 sensors in the fif file

epochs_S_D_I = mne.EpochsArray(S_cueD_targetI_Suj1_rej['trial'], info=info, tmin=tmin, baseline=baseline) #here is where I am switching to the .mat structure where I have my epochs

#Compute the evoked response
evoked = epochs_S_D_I.average()
evoked.plot(time_unit='s') #this plot function works fine

evoked.plot_topomap(ch_type='mag', time_unit='s') #this does not

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190108/97b23c93/attachment-0001.html

External Email - Use Caution

hi Alfredo,

it's possibly a bug or at least a limitation of the create_info when
you say "mag".

can you share a snippet that illustrates the problem using the sample data?

btw why don't you have already the montage in your MEG fif file? it's weird
that you need to load it from a different file.

Alex