Skip to content

ref_meg trouble #5384

Closed
Closed

Description

@jona-sassenhagen

My MEG data says this now with essentially anything I do:

~/tools/mne-python/mne/io/pick.py in pick_info(info, sel, copy)
    406                     'compensation channels are missing: %s\n'
    407                     'Either remove compensation or pick compensation '
--> 408                     'channels' % (current_comp, comps_missing))
    409             else:
    410                 logger.info('Removing %d compensators from info because '

RuntimeError: Compensation grade 3 has been applied, but compensation channels are missing: ['BG1-3609', 'BG2-3609', 'BG3-3609', 'G11-3609', 'G12-3609', 'G13-3609', 'G22-3609', 'G23-3609', 'P11-3609', 'P12-3609', 'Q11-3609', 'Q12-3609', 'Q13-3609', 'R12-3609', 'R13-3609', 'R22-3609', 'R23-3609']
Either remove compensation or pick compensation channels

... what? Happens, for example, when I do raw.pick_types(meg=True, ref_meg=False).
I can raw.apply_gradient_compensation(0), but then my data looks kind of shitty.

Activity

  1. jona-sassenhagen commented on Jul 31, 2018

    @jona-sassenhagen
    ContributorAuthor

    This works:

    picks = mne.pick_types(raw.info, meg=True, ref_meg=False)
    mne.viz.plot_topomap(raw._data[picks], mne.pick_info(raw.copy().apply_gradient_compensation(0).info, picks));
    

    But it feels very wrong. And it doesn't work for many functions.

  2. larsoner commented on Jul 31, 2018

    @larsoner
    Member

    We have had a number of these. Should be fixed by #5342, feel free to comment on that proposal

  3. added this to the 0.17 milestone on Jul 31, 2018
  4. agramfort commented on Aug 1, 2018

    @agramfort
    SponsorMember

    @jona-sassenhagen what is a gist that allows to replicate this issue? you have a number of tiny CTF files in the mne-testing-data folder.

  5. agramfort commented on Aug 4, 2018

    @agramfort
    SponsorMember

    @jona-sassenhagen a fix along these lines #5388

    please share a gist to know how we can fix this.

  6. larsoner commented on Oct 4, 2018

    @larsoner
    Member

    @jona-sassenhagen can you write a minimal example from a testing or mne/io/data/*.fif file? It will make it easy for us to test that fixes/workarounds from #5342 work. It would be good to get to this example in the next week so a fix can be made the next week to make it into 0.17.

  7. self-assigned this
    on Oct 4, 2018
  8. larsoner commented on Oct 8, 2018

    @larsoner
    Member

    @jona-sassenhagen any chance to make this gist quickly? There is a PR open to take care of most of these problems and it would be great to have this test case

  9. larsoner commented on Oct 8, 2018

    @larsoner
    Member

    Okay actually I think this does it:

    import os.path as op
    import mne
    raw = mne.io.read_raw_fif(op.join(op.dirname(mne.__file__), 'io', 'tests',
                                      'data', 'test_ctf_comp_raw.fif'))
    evoked = mne.EvokedArray(raw[:, :10][0], raw.info)
    evoked.pick_types(meg=True, ref_meg=False)
    evoked.plot_topomap()
    

    It fails on master but passes on the open PR, fortunately!

  10. added a commit that references this issue on Oct 12, 2018
    46f3fa1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions