{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/38658237","id":38658237,"diff_hunk":"@@ -505,3 +539,38 @@ def _update_sss_info(raw, origin, int_order, ext_order, nsens):\n         raw.info['proc_history'] = [proc_block]\n \n     return raw\n+\n+\n+def _overlap_projector(data_int, data_res, delta=0.02):\n+    \"\"\"Calculate projector for removal of subspace intersection in tSSS\"\"\"\n+    # delta necessary to deal with noise when finding identical signal\n+    # directions in the subspace. See the end of the Results section in [2]_\n+\n+    # Note that the procedure here is an updated version of [2]_ using\n+    # residuals instead of internal/external spaces directly. This provides\n+    # data with higher rank to work with.\n+\n+    # Normalize data\n+    normed_data_int = data_int / norm(data_int)\n+    normed_data_res = data_res / norm(data_res)\n+\n+    # Compute orth to get temporal bases. Matrices must have shape\n+    # (n_samps x effective_rank) when passed into svd computation\n+    orth_int = orth(normed_data_int.T)\n+    orth_res = orth(normed_data_res.T)\n+\n+    Q_int, _ = qr(orth_int, mode='economic')\n+    Q_res, _ = qr(orth_res, mode='economic')\n+\n+    C_mat = np.dot(Q_int.T, Q_res)\n+\n+    # Compute angles between subspace and which bases to keep\n+    _, S_intersect, Vh_intersect = svd(C_mat)\n+    retain_inds = S_intersect >= (1 - delta)\n+\n+    # Compute projection operator as (I-LL_T) Eq. 12 in [2]_\n+    # V_principal should be shape (n_time_pts x n_retained_inds)\n+    V_principal = np.dot(Q_res, Vh_intersect.T)[:, retain_inds]","path":"mne/preprocessing/maxwell.py","position":141,"original_position":141,"commit_id":"525912fa7d9694b31f4ff6eb27b3a87d4205155b","original_commit_id":"525912fa7d9694b31f4ff6eb27b3a87d4205155b","user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"body":"There is something wrong here:\r\n```\r\n/home/larsoner/custombuilds/mne-python/mne/preprocessing/maxwell.py:573: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 1; dimension is 211 but corresponding boolean dimension is 80\r\n  V_principal = np.dot(Q_res, Vh_intersect.T)[:, retain_inds]\r\n```","created_at":"2015-09-03T15:22:45Z","updated_at":"2015-09-03T15:22:45Z","html_url":"https://github.com/mne-tools/mne-python/pull/2400#discussion_r38658237","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/38658237"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/2400#discussion_r38658237"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400","id":42269740,"html_url":"https://github.com/mne-tools/mne-python/pull/2400","diff_url":"https://github.com/mne-tools/mne-python/pull/2400.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/2400.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2400","number":2400,"state":"open","locked":false,"title":"[WIP] SSS: tSSS","user":{"login":"wronk","id":5296721,"avatar_url":"https://avatars.githubusercontent.com/u/5296721?v=3","gravatar_id":"","url":"https://api.github.com/users/wronk","html_url":"https://github.com/wronk","followers_url":"https://api.github.com/users/wronk/followers","following_url":"https://api.github.com/users/wronk/following{/other_user}","gists_url":"https://api.github.com/users/wronk/gists{/gist_id}","starred_url":"https://api.github.com/users/wronk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wronk/subscriptions","organizations_url":"https://api.github.com/users/wronk/orgs","repos_url":"https://api.github.com/users/wronk/repos","events_url":"https://api.github.com/users/wronk/events{/privacy}","received_events_url":"https://api.github.com/users/wronk/received_events","type":"User","site_admin":false},"body":"PR to implement temporal SSS into the SSS package\r\n\r\n* [x] Add new input params/associated documentation for tSSS and link to the relevant paper\r\n* [x] Create function to calculate a projector to project out common signal-space directions\r\n* [x] Create new tests \r\n* [x] Add new testing data to MNE-testing-data\r\n* [x] Verify against Samu's tSSS results\r\n* [ ] Verify against Elekta's tSSS results or reconcile differences\r\n\r\nWill require `MNE-testing-data` to be updated","created_at":"2015-08-12T18:07:49Z","updated_at":"2015-09-03T15:22:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ead54612cc7c298b8d2a69100dae2853d06979b5","assignee":null,"milestone":{"url":"https://api.github.com/repos/mne-tools/mne-python/milestones/6","html_url":"https://github.com/mne-tools/mne-python/milestones/0.10","labels_url":"https://api.github.com/repos/mne-tools/mne-python/milestones/6/labels","id":1074222,"number":6,"title":"0.10","description":"","creator":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":46,"state":"open","created_at":"2015-04-19T22:04:00Z","updated_at":"2015-09-03T15:20:08Z","due_on":"2015-09-30T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400/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/2400/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/525912fa7d9694b31f4ff6eb27b3a87d4205155b","head":{"label":"wronk:tSSS","ref":"tSSS","sha":"525912fa7d9694b31f4ff6eb27b3a87d4205155b","user":{"login":"wronk","id":5296721,"avatar_url":"https://avatars.githubusercontent.com/u/5296721?v=3","gravatar_id":"","url":"https://api.github.com/users/wronk","html_url":"https://github.com/wronk","followers_url":"https://api.github.com/users/wronk/followers","following_url":"https://api.github.com/users/wronk/following{/other_user}","gists_url":"https://api.github.com/users/wronk/gists{/gist_id}","starred_url":"https://api.github.com/users/wronk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wronk/subscriptions","organizations_url":"https://api.github.com/users/wronk/orgs","repos_url":"https://api.github.com/users/wronk/repos","events_url":"https://api.github.com/users/wronk/events{/privacy}","received_events_url":"https://api.github.com/users/wronk/received_events","type":"User","site_admin":false},"repo":{"id":12385398,"name":"mne-python","full_name":"wronk/mne-python","owner":{"login":"wronk","id":5296721,"avatar_url":"https://avatars.githubusercontent.com/u/5296721?v=3","gravatar_id":"","url":"https://api.github.com/users/wronk","html_url":"https://github.com/wronk","followers_url":"https://api.github.com/users/wronk/followers","following_url":"https://api.github.com/users/wronk/following{/other_user}","gists_url":"https://api.github.com/users/wronk/gists{/gist_id}","starred_url":"https://api.github.com/users/wronk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wronk/subscriptions","organizations_url":"https://api.github.com/users/wronk/orgs","repos_url":"https://api.github.com/users/wronk/repos","events_url":"https://api.github.com/users/wronk/events{/privacy}","received_events_url":"https://api.github.com/users/wronk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wronk/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/wronk/mne-python","forks_url":"https://api.github.com/repos/wronk/mne-python/forks","keys_url":"https://api.github.com/repos/wronk/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wronk/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wronk/mne-python/teams","hooks_url":"https://api.github.com/repos/wronk/mne-python/hooks","issue_events_url":"https://api.github.com/repos/wronk/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/wronk/mne-python/events","assignees_url":"https://api.github.com/repos/wronk/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/wronk/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/wronk/mne-python/tags","blobs_url":"https://api.github.com/repos/wronk/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wronk/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wronk/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/wronk/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wronk/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/wronk/mne-python/languages","stargazers_url":"https://api.github.com/repos/wronk/mne-python/stargazers","contributors_url":"https://api.github.com/repos/wronk/mne-python/contributors","subscribers_url":"https://api.github.com/repos/wronk/mne-python/subscribers","subscription_url":"https://api.github.com/repos/wronk/mne-python/subscription","commits_url":"https://api.github.com/repos/wronk/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/wronk/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/wronk/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/wronk/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/wronk/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/wronk/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wronk/mne-python/merges","archive_url":"https://api.github.com/repos/wronk/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wronk/mne-python/downloads","issues_url":"https://api.github.com/repos/wronk/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/wronk/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/wronk/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/wronk/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wronk/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/wronk/mne-python/releases{/id}","created_at":"2013-08-26T17:36:28Z","updated_at":"2015-05-07T21:22:18Z","pushed_at":"2015-08-25T13:58:00Z","git_url":"git://github.com/wronk/mne-python.git","ssh_url":"git@github.com:wronk/mne-python.git","clone_url":"https://github.com/wronk/mne-python.git","svn_url":"https://github.com/wronk/mne-python","homepage":"http://martinos.org/mne/","size":80908,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"60668ecb14917f2407c154faf57d7c0b9aedb0c0","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-08-23T12:38:45Z","pushed_at":"2015-09-03T14:57:01Z","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":181968,"stargazers_count":145,"watchers_count":145,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":140,"mirror_url":null,"open_issues_count":194,"forks":140,"open_issues":194,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/2400"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/2400"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/2400/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2400/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/2400/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/525912fa7d9694b31f4ff6eb27b3a87d4205155b"}}}}