Skip to content

Magnetometer positions look odd in PSD plot #7837

Closed

Description

@hoechenberger

Steps to reproduce

Let's first visualize the magnetometer channel positions via Raw.plot_sensors():

import mne
from mne.datasets import sample


data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)
raw.plot_sensors(ch_type='mag')

This produces:
sensors

Looking good. Now let's plot PSDs of the data.

raw.plot_psd()

Result cropped so it only shows the sensor positions (top to bottom: mag, grad, eeg):
Figure_1 copy

The magnetometer sensor layout looks incorrect, and doesn't match the one produced by plot_sensors(). Am I missing something here?

cc @agramfort

Activity

  1. agramfort commented on May 27, 2020

    @agramfort
    SponsorMember
  2. larsoner commented on May 27, 2020

    @larsoner
    Member

    Agreed it's a bug, no idea the cause. Someone will have to dig into the viz code to figure out why this is happening...

  3. agramfort commented on Jun 8, 2020

    @agramfort
    SponsorMember

    this allows to clearly show the bug:

    import mne
    import os
    
    sample_data_folder = mne.datasets.sample.data_path()
    sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                        'sample_audvis_raw.fif')
    raw = mne.io.read_raw_fif(sample_data_raw_file, preload=True)
    raw.plot_psd(picks=['grad'])
    raw.plot_psd(picks=['mag'])
    raw.plot_psd(picks=['meg'])
    
  4. agramfort commented on Jun 8, 2020

    @agramfort
    SponsorMember

    and the bad news is that the bug is in the 0.20 stable release :( :(

  5. larsoner commented on Jun 8, 2020

    @larsoner
    Member

    I'll git bisect and see how hard it is to fix

  6. agramfort commented on Jun 8, 2020

    @agramfort
    SponsorMember

    thanks

  7. larsoner commented on Jun 8, 2020

    @larsoner
    Member

    Looks like it was 9e78506 / #7486, cc @drammock -- I'll see if I can figure out what the problem is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions