{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/27770019","id":27770019,"diff_hunk":"@@ -0,0 +1,175 @@\n+# Authors: Yousra Bekhti <yousra.bekhti@gmail.com>\n+#          Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n+#\n+# License: BSD (3-clause)\n+\n+import os.path as op\n+import numpy as np\n+\n+import warnings\n+from nose.tools import assert_true\n+from numpy.testing import assert_array_almost_equal\n+\n+\n+import mne\n+from mne.datasets import testing\n+from mne.beamformer import rap_music\n+from mne.utils import slow_test\n+\n+\n+data_path = testing.data_path(download=False)\n+fname_raw = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc_raw.fif')\n+fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc-cov.fif')\n+fname_fwd = op.join(data_path, 'MEG', 'sample',\n+                    'sample_audvis_trunc-meg-eeg-oct-4-fwd.fif')\n+fname_event = op.join(data_path, 'MEG', 'sample',\n+                      'sample_audvis_trunc_raw-eve.fif')\n+\n+warnings.simplefilter('always')  # enable b/c these tests throw warnings\n+\n+\n+def read_forward_solution_meg(fname_fwd, ch_names, **kwargs):\n+    fwd = mne.read_forward_solution(fname_fwd, **kwargs)\n+    return mne.pick_types_forward(fwd, eeg=False, include=ch_names,\n+                                  exclude=['MEG 2443'])\n+\n+\n+def _get_data(tmin=-0.1, tmax=0.15, event_id=1):\n+    \"\"\"Read in data used in tests\n+    \"\"\"\n+    events = mne.read_events(fname_event)\n+    raw = mne.io.Raw(fname_raw, preload=True)\n+\n+    # Setup for reading the raw data\n+    raw.info['bads'] = ['MEG 2443']  # 2 bads channels\n+\n+    # Set up pick list: MEG - bad channels\n+    picks = mne.pick_types(raw.info, meg=True, eeg=False, stim=False,\n+                           eog=True, ref_meg=False, exclude='bads')\n+\n+    # Read epochs\n+    epochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=True,\n+                        picks=picks, baseline=(None, 0), preload=False,\n+                        reject=dict(grad=4000e-13, mag=4e-12, eog=150e-6))\n+\n+    evoked = epochs.average()","path":"mne/beamformer/tests/test_rap_music.py","position":55,"original_position":55,"commit_id":"6a31f6d0f0a35e6ca2f29937d94cac0ff661d935","original_commit_id":"6a31f6d0f0a35e6ca2f29937d94cac0ff661d935","user":{"login":"agramfort","id":161052,"avatar_url":"https://avatars.githubusercontent.com/u/161052?v=3","gravatar_id":"","url":"https://api.github.com/users/agramfort","html_url":"https://github.com/agramfort","followers_url":"https://api.github.com/users/agramfort/followers","following_url":"https://api.github.com/users/agramfort/following{/other_user}","gists_url":"https://api.github.com/users/agramfort/gists{/gist_id}","starred_url":"https://api.github.com/users/agramfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agramfort/subscriptions","organizations_url":"https://api.github.com/users/agramfort/orgs","repos_url":"https://api.github.com/users/agramfort/repos","events_url":"https://api.github.com/users/agramfort/events{/privacy}","received_events_url":"https://api.github.com/users/agramfort/received_events","type":"User","site_admin":false},"body":"wait you use the precomputed noise cov. So do the same\r\nwith evoked.","created_at":"2015-04-04T16:16:30Z","updated_at":"2015-04-04T16:16:30Z","html_url":"https://github.com/mne-tools/mne-python/pull/1815#discussion_r27770019","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/27770019"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/1815#discussion_r27770019"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815","id":29715483,"html_url":"https://github.com/mne-tools/mne-python/pull/1815","diff_url":"https://github.com/mne-tools/mne-python/pull/1815.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/1815.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/1815","number":1815,"state":"open","locked":false,"title":"Source Localization using Rap-Music","user":{"login":"yousrabk","id":4352445,"avatar_url":"https://avatars.githubusercontent.com/u/4352445?v=3","gravatar_id":"","url":"https://api.github.com/users/yousrabk","html_url":"https://github.com/yousrabk","followers_url":"https://api.github.com/users/yousrabk/followers","following_url":"https://api.github.com/users/yousrabk/following{/other_user}","gists_url":"https://api.github.com/users/yousrabk/gists{/gist_id}","starred_url":"https://api.github.com/users/yousrabk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yousrabk/subscriptions","organizations_url":"https://api.github.com/users/yousrabk/orgs","repos_url":"https://api.github.com/users/yousrabk/repos","events_url":"https://api.github.com/users/yousrabk/events{/privacy}","received_events_url":"https://api.github.com/users/yousrabk/received_events","type":"User","site_admin":false},"body":"Here is an implementation of the Rap-Music source localization @joewalter, @agramfort if I'm missing anything, let me know.\r\n","created_at":"2015-02-20T17:45:02Z","updated_at":"2015-04-04T16:16:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a85a07883b3c585f3d7151d51c4ca0c66d97c673","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815/comments","review_comment_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/1815/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/6a31f6d0f0a35e6ca2f29937d94cac0ff661d935","head":{"label":"yousrabk:rapmusic","ref":"rapmusic","sha":"6a31f6d0f0a35e6ca2f29937d94cac0ff661d935","user":{"login":"yousrabk","id":4352445,"avatar_url":"https://avatars.githubusercontent.com/u/4352445?v=3","gravatar_id":"","url":"https://api.github.com/users/yousrabk","html_url":"https://github.com/yousrabk","followers_url":"https://api.github.com/users/yousrabk/followers","following_url":"https://api.github.com/users/yousrabk/following{/other_user}","gists_url":"https://api.github.com/users/yousrabk/gists{/gist_id}","starred_url":"https://api.github.com/users/yousrabk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yousrabk/subscriptions","organizations_url":"https://api.github.com/users/yousrabk/orgs","repos_url":"https://api.github.com/users/yousrabk/repos","events_url":"https://api.github.com/users/yousrabk/events{/privacy}","received_events_url":"https://api.github.com/users/yousrabk/received_events","type":"User","site_admin":false},"repo":{"id":29482908,"name":"mne-python","full_name":"yousrabk/mne-python","owner":{"login":"yousrabk","id":4352445,"avatar_url":"https://avatars.githubusercontent.com/u/4352445?v=3","gravatar_id":"","url":"https://api.github.com/users/yousrabk","html_url":"https://github.com/yousrabk","followers_url":"https://api.github.com/users/yousrabk/followers","following_url":"https://api.github.com/users/yousrabk/following{/other_user}","gists_url":"https://api.github.com/users/yousrabk/gists{/gist_id}","starred_url":"https://api.github.com/users/yousrabk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yousrabk/subscriptions","organizations_url":"https://api.github.com/users/yousrabk/orgs","repos_url":"https://api.github.com/users/yousrabk/repos","events_url":"https://api.github.com/users/yousrabk/events{/privacy}","received_events_url":"https://api.github.com/users/yousrabk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yousrabk/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/yousrabk/mne-python","forks_url":"https://api.github.com/repos/yousrabk/mne-python/forks","keys_url":"https://api.github.com/repos/yousrabk/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yousrabk/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yousrabk/mne-python/teams","hooks_url":"https://api.github.com/repos/yousrabk/mne-python/hooks","issue_events_url":"https://api.github.com/repos/yousrabk/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/yousrabk/mne-python/events","assignees_url":"https://api.github.com/repos/yousrabk/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/yousrabk/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/yousrabk/mne-python/tags","blobs_url":"https://api.github.com/repos/yousrabk/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yousrabk/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yousrabk/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/yousrabk/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yousrabk/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/yousrabk/mne-python/languages","stargazers_url":"https://api.github.com/repos/yousrabk/mne-python/stargazers","contributors_url":"https://api.github.com/repos/yousrabk/mne-python/contributors","subscribers_url":"https://api.github.com/repos/yousrabk/mne-python/subscribers","subscription_url":"https://api.github.com/repos/yousrabk/mne-python/subscription","commits_url":"https://api.github.com/repos/yousrabk/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/yousrabk/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/yousrabk/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/yousrabk/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/yousrabk/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/yousrabk/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yousrabk/mne-python/merges","archive_url":"https://api.github.com/repos/yousrabk/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yousrabk/mne-python/downloads","issues_url":"https://api.github.com/repos/yousrabk/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/yousrabk/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/yousrabk/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/yousrabk/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yousrabk/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/yousrabk/mne-python/releases{/id}","created_at":"2015-01-19T17:36:48Z","updated_at":"2015-01-19T21:21:48Z","pushed_at":"2015-03-30T15:32:31Z","git_url":"git://github.com/yousrabk/mne-python.git","ssh_url":"git@github.com:yousrabk/mne-python.git","clone_url":"https://github.com/yousrabk/mne-python.git","svn_url":"https://github.com/yousrabk/mne-python","homepage":"http://martinos.org/mne/","size":74472,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"ae108bf31cdd83d69bb89440ef02d4455518665a","user":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"repo":{"id":1301584,"name":"mne-python","full_name":"mne-tools/mne-python","owner":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mne-tools/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":false,"url":"https://api.github.com/repos/mne-tools/mne-python","forks_url":"https://api.github.com/repos/mne-tools/mne-python/forks","keys_url":"https://api.github.com/repos/mne-tools/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mne-tools/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mne-tools/mne-python/teams","hooks_url":"https://api.github.com/repos/mne-tools/mne-python/hooks","issue_events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/mne-tools/mne-python/events","assignees_url":"https://api.github.com/repos/mne-tools/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/mne-tools/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/mne-tools/mne-python/tags","blobs_url":"https://api.github.com/repos/mne-tools/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mne-tools/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mne-tools/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mne-tools/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mne-tools/mne-python/languages","stargazers_url":"https://api.github.com/repos/mne-tools/mne-python/stargazers","contributors_url":"https://api.github.com/repos/mne-tools/mne-python/contributors","subscribers_url":"https://api.github.com/repos/mne-tools/mne-python/subscribers","subscription_url":"https://api.github.com/repos/mne-tools/mne-python/subscription","commits_url":"https://api.github.com/repos/mne-tools/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mne-tools/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mne-tools/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/mne-tools/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mne-tools/mne-python/merges","archive_url":"https://api.github.com/repos/mne-tools/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mne-tools/mne-python/downloads","issues_url":"https://api.github.com/repos/mne-tools/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/mne-tools/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mne-tools/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mne-tools/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mne-tools/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/mne-tools/mne-python/releases{/id}","created_at":"2011-01-28T03:31:13Z","updated_at":"2015-04-03T12:11:09Z","pushed_at":"2015-04-04T16:14:44Z","git_url":"git://github.com/mne-tools/mne-python.git","ssh_url":"git@github.com:mne-tools/mne-python.git","clone_url":"https://github.com/mne-tools/mne-python.git","svn_url":"https://github.com/mne-tools/mne-python","homepage":"http://martinos.org/mne/","size":164153,"stargazers_count":122,"watchers_count":122,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":109,"mirror_url":null,"open_issues_count":157,"forks":109,"open_issues":157,"watchers":122,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/1815"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/1815"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/1815/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815/comments"},"review_comment":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1815/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/6a31f6d0f0a35e6ca2f29937d94cac0ff661d935"}}}}