{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/28644887","id":28644887,"diff_hunk":"@@ -253,9 +338,89 @@ def _do_self_dots_subset(intrad, rmags, rlens, cosmags, ws, volume, lut,\n     return products\n \n \n+def _do_cross_dots(intrad, volume, coils1, coils2, r0, ch_type,\n+                   lut, n_fact):\n+    \"\"\"Compute lead field dot product integrations between two coil sets.\n+\n+    Parameters\n+    ----------\n+    intrad : float\n+        The integration radius. It is used to calculate beta as:\n+        beta = (intrad * intrad) / (r1 * r2).\n+    volume : bool\n+        If True, compute volume integral.\n+    coils1 : list of dict\n+        The original coils.\n+    coils2 : list of dict\n+        The coils to which data is being mapped.\n+    r0 : array, shape (3 x 1).\n+        The origin of the sphere.\n+    ch_type : str\n+        The channel type. It can be 'meg' or 'eeg'\n+    Returns\n+    -------\n+    products : array, shape (n_coils, n_coils)\n+        The integration products.\n+    \"\"\"\n+    rmags1 = [coil['rmag'] - r0[np.newaxis, :] for coil in coils1]\n+    rmags2 = [coil['rmag'] - r0[np.newaxis, :] for coil in coils2]\n+\n+    rlens1 = [np.sqrt(np.sum(r * r, axis=1)) for r in rmags1]\n+    rlens2 = [np.sqrt(np.sum(r * r, axis=1)) for r in rmags2]\n+\n+    rmags1 = [r / rl[:, np.newaxis] for r, rl in zip(rmags1, rlens1)]\n+    rmags2 = [r / rl[:, np.newaxis] for r, rl in zip(rmags2, rlens2)]\n+\n+    ws1 = [coil['w'] for coil in coils1]\n+    ws2 = [coil['w'] for coil in coils2]\n+\n+    cosmags1 = [coil['cosmag'] for coil in coils1]\n+    cosmags2 = [coil['cosmag'] for coil in coils2]\n+\n+    products = np.zeros((len(rmags1), len(rmags2)))\n+    for ci1, coil1 in enumerate(coils1):\n+        for ci2, coil2 in enumerate(coils2):\n+            res = _fast_sphere_dot_r0(intrad, rmags1[ci1], rmags2[ci2],\n+                                      rlens1[ci1], rlens2[ci2], cosmags1[ci1],\n+                                      cosmags2[ci2], ws1[ci1], ws2[ci2],\n+                                      volume, lut, n_fact, ch_type)\n+            products[ci1, ci2] = res\n+    return products\n+\n+\n def _do_surface_dots(intrad, volume, coils, surf, sel, r0, ch_type,\n                      lut, n_fact, n_jobs):\n-    \"\"\"Compute the map construction products\"\"\"\n+    \"\"\"Compute the map construction products\n+\n+    Parameters\n+    ----------\n+    intrad : float\n+        The integration radius. It is used to calculate beta as:\n+        beta = (intrad * intrad) / (r1 * r2)\n+    volume : bool\n+        If True, compute a volume integral.\n+    coils : list of dist\n+        The coils.\n+    surf : dict\n+        The surface on which the field is interpolated.\n+    sel : array\n+        Indices of the surface vertices to select.\n+    r0 : array, shape (3 x 1)\n+        origin of the sphere.","path":"mne/forward/_lead_dots.py","position":196,"original_position":196,"commit_id":"8b3bd7b2e5e63f2bea7fbef7cbf02a11db8d64d6","original_commit_id":"8b3bd7b2e5e63f2bea7fbef7cbf02a11db8d64d6","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":"also `list of dict` not `list of dist` above","created_at":"2015-04-18T15:33:53Z","updated_at":"2015-04-18T15:33:53Z","html_url":"https://github.com/mne-tools/mne-python/pull/1943#discussion_r28644887","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/28644887"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/1943#discussion_r28644887"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943","id":33069689,"html_url":"https://github.com/mne-tools/mne-python/pull/1943","diff_url":"https://github.com/mne-tools/mne-python/pull/1943.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/1943.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/1943","number":1943,"state":"open","locked":false,"title":"WIP: Virtual sensors / remap sensors","user":{"login":"mainakjas","id":3817535,"avatar_url":"https://avatars.githubusercontent.com/u/3817535?v=3","gravatar_id":"","url":"https://api.github.com/users/mainakjas","html_url":"https://github.com/mainakjas","followers_url":"https://api.github.com/users/mainakjas/followers","following_url":"https://api.github.com/users/mainakjas/following{/other_user}","gists_url":"https://api.github.com/users/mainakjas/gists{/gist_id}","starred_url":"https://api.github.com/users/mainakjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainakjas/subscriptions","organizations_url":"https://api.github.com/users/mainakjas/orgs","repos_url":"https://api.github.com/users/mainakjas/repos","events_url":"https://api.github.com/users/mainakjas/events{/privacy}","received_events_url":"https://api.github.com/users/mainakjas/received_events","type":"User","site_admin":false},"body":"Closes https://github.com/mne-tools/mne-python/issues/1080. Here's what you get when you remap mag to grad for sample.\r\n\r\n![virtual_channels](https://cloud.githubusercontent.com/assets/3817535/7093819/c7c7d004-dfbc-11e4-978a-1ed71c0f6289.png)\r\nStill needs to be made nicer with tests and better options in API.\r\n\r\ncc @Anevar @agramfort ","created_at":"2015-04-10T18:08:53Z","updated_at":"2015-04-18T15:33:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8641d3bee5728279adfcf315fe195d551b74214b","assignee":null,"milestone":{"url":"https://api.github.com/repos/mne-tools/mne-python/milestones/5","html_url":"https://github.com/mne-tools/mne-python/milestones/0.9","labels_url":"https://api.github.com/repos/mne-tools/mne-python/milestones/5/labels","id":1011721,"number":5,"title":"0.9","description":null,"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":24,"closed_issues":59,"state":"open","created_at":"2015-03-09T03:10:39Z","updated_at":"2015-04-18T13:50:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943/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/1943/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/8b3bd7b2e5e63f2bea7fbef7cbf02a11db8d64d6","head":{"label":"mainakjas:virtual_sensors","ref":"virtual_sensors","sha":"8b3bd7b2e5e63f2bea7fbef7cbf02a11db8d64d6","user":{"login":"mainakjas","id":3817535,"avatar_url":"https://avatars.githubusercontent.com/u/3817535?v=3","gravatar_id":"","url":"https://api.github.com/users/mainakjas","html_url":"https://github.com/mainakjas","followers_url":"https://api.github.com/users/mainakjas/followers","following_url":"https://api.github.com/users/mainakjas/following{/other_user}","gists_url":"https://api.github.com/users/mainakjas/gists{/gist_id}","starred_url":"https://api.github.com/users/mainakjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainakjas/subscriptions","organizations_url":"https://api.github.com/users/mainakjas/orgs","repos_url":"https://api.github.com/users/mainakjas/repos","events_url":"https://api.github.com/users/mainakjas/events{/privacy}","received_events_url":"https://api.github.com/users/mainakjas/received_events","type":"User","site_admin":false},"repo":{"id":8892606,"name":"mne-python","full_name":"mainakjas/mne-python","owner":{"login":"mainakjas","id":3817535,"avatar_url":"https://avatars.githubusercontent.com/u/3817535?v=3","gravatar_id":"","url":"https://api.github.com/users/mainakjas","html_url":"https://github.com/mainakjas","followers_url":"https://api.github.com/users/mainakjas/followers","following_url":"https://api.github.com/users/mainakjas/following{/other_user}","gists_url":"https://api.github.com/users/mainakjas/gists{/gist_id}","starred_url":"https://api.github.com/users/mainakjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainakjas/subscriptions","organizations_url":"https://api.github.com/users/mainakjas/orgs","repos_url":"https://api.github.com/users/mainakjas/repos","events_url":"https://api.github.com/users/mainakjas/events{/privacy}","received_events_url":"https://api.github.com/users/mainakjas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mainakjas/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/mainakjas/mne-python","forks_url":"https://api.github.com/repos/mainakjas/mne-python/forks","keys_url":"https://api.github.com/repos/mainakjas/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mainakjas/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mainakjas/mne-python/teams","hooks_url":"https://api.github.com/repos/mainakjas/mne-python/hooks","issue_events_url":"https://api.github.com/repos/mainakjas/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/mainakjas/mne-python/events","assignees_url":"https://api.github.com/repos/mainakjas/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/mainakjas/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/mainakjas/mne-python/tags","blobs_url":"https://api.github.com/repos/mainakjas/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mainakjas/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mainakjas/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mainakjas/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mainakjas/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mainakjas/mne-python/languages","stargazers_url":"https://api.github.com/repos/mainakjas/mne-python/stargazers","contributors_url":"https://api.github.com/repos/mainakjas/mne-python/contributors","subscribers_url":"https://api.github.com/repos/mainakjas/mne-python/subscribers","subscription_url":"https://api.github.com/repos/mainakjas/mne-python/subscription","commits_url":"https://api.github.com/repos/mainakjas/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mainakjas/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mainakjas/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mainakjas/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mainakjas/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/mainakjas/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mainakjas/mne-python/merges","archive_url":"https://api.github.com/repos/mainakjas/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mainakjas/mne-python/downloads","issues_url":"https://api.github.com/repos/mainakjas/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/mainakjas/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mainakjas/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mainakjas/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mainakjas/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/mainakjas/mne-python/releases{/id}","created_at":"2013-03-20T00:17:33Z","updated_at":"2014-12-06T15:03:01Z","pushed_at":"2015-04-18T13:33:10Z","git_url":"git://github.com/mainakjas/mne-python.git","ssh_url":"git@github.com:mainakjas/mne-python.git","clone_url":"https://github.com/mainakjas/mne-python.git","svn_url":"https://github.com/mainakjas/mne-python","homepage":"http://martinos.org/mne/","size":76901,"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":"dc7d754ca41279559253b58c20a1cb4c32703a07","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-18T07:05:27Z","pushed_at":"2015-04-18T14:14:56Z","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":166146,"stargazers_count":127,"watchers_count":127,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":141,"forks":110,"open_issues":141,"watchers":127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/1943"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/1943"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/1943/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/1943/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/1943/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/8b3bd7b2e5e63f2bea7fbef7cbf02a11db8d64d6"}}}}