I don’t get an error while using the sample data. But when I am using my data, and selecting grad channels for the normalization I am getting error in the following line
If it works for the sample data but fails with your own data, it will be very difficult for anyone to help you debug if they don’t have the data that causes the error. Can you share a link to a file that causes the ValueError, and a code sample that is complete (someone can copy/paste in its entirety and get the same ValueError you see) but also as minimal as possible (all extraneous steps removed)?
Might not be able to share the data.
What causes this error? The operations done on raw are using mne functions. POS data is modified by pick_channels.
If I were to debug it myself, where should I start?
To debug this yourself, try to execute your line/steps one at a time and systematically check the dimension of your data to find where one channel is dropped. To check the dimension, you can get the numpy array and check with .shape. To get the numpy array, you can used e.g. raw.get_data(picks='all').
OK, then what about sharing a minimal, complete example at least? If it’s an error in your code, we might be able to spot it if we could see your code.
The first 2 arguments to plot_topomap are data and pos. They need to be the same length, and apparently in your data they are not the same length.
Thanks to everyone.
Your replies helped me debug it. I have been rejecting bad channels based on my initial analysis. And was rejecting two unpaired grad channels. I have rewritten to reject both grad channels, if one of the pair is found bad. That solved the issue.