{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/36632129","id":36632129,"diff_hunk":"@@ -157,4 +163,66 @@ def test_maxwell_filter_additional():\n     assert_equal(cov_raw_rank, raw.info['nchan'])\n     assert_equal(cov_sss_rank, maxwell.get_num_moments(int_order, 0))\n \n+\n+@testing.requires_testing_data\n+def test_maxwell_filter_fine_calibration():\n+    \"\"\"Test fine calibration feature of Maxwell filter\n+\n+    Notes\n+    -----\n+    Elekta MaxFilter uses single precision, so expect filtered results to\n+    differ slightly.\n+    \"\"\"\n+\n+    # Load testing data (raw, SSS std origin, SSS non-standard origin)\n+    with warnings.catch_warnings(record=True):  # maxshield\n+        raw = Raw(raw_fname, preload=False, proj=False,\n+                  allow_maxshield=True).crop(0., 1., False)\n+    raw.preload_data()\n+    raw.pick_types(meg=True, eeg=False)\n+    with warnings.catch_warnings(record=True):  # maxshield, naming\n+        sss_fine_cal = Raw(sss_fine_cal_fname, preload=True, proj=False,\n+                           allow_maxshield=True)\n+\n+    # Create coils\n+    all_coils, _, _, meg_info = _prep_meg_channels(raw.info, ignore_ref=True,\n+                                                   elekta_defs=True)\n+    picks = [raw.info['ch_names'].index(ch) for ch in [coil['chname']\n+                                                       for coil in all_coils]]\n+\n+    # Test 1D SSS fine calibration\n+    raw_sss = maxwell.maxwell_filter(raw, origin=[0., 0., 40.],","path":"mne/preprocessing/tests/test_maxwell.py","position":120,"original_position":120,"commit_id":"d0e0d2fa959ac9e624139823822de7ada9fc9208","original_commit_id":"d0e0d2fa959ac9e624139823822de7ada9fc9208","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":"to save some lines, do `from mne.preprocessing import maxwell_filter` at the top. Same with the private functions, you can do `from mne.preprocessing.maxwell import ...`. It's what we usually do anyway.","created_at":"2015-08-10T13:47:16Z","updated_at":"2015-08-10T13:47:16Z","html_url":"https://github.com/mne-tools/mne-python/pull/2374#discussion_r36632129","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/36632129"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/2374#discussion_r36632129"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374","id":41385828,"html_url":"https://github.com/mne-tools/mne-python/pull/2374","diff_url":"https://github.com/mne-tools/mne-python/pull/2374.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/2374.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2374","number":2374,"state":"open","locked":false,"title":"[WIP] SSS: Add Fine Calibration","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":"Add improved calibration to the SSS functionality. This should increase the SSS shielding factor by ~10x making it useful for actual data processing.\r\n\r\n* [x] Add option to use sensor geometry from `sss_cal.dat` files instead of `raw`\r\n* [x] Quantify difference in geometry and send to `logger` along with fine calibration file used\r\n* [x] Add point-like magnetometers (X, Y, and Z) to gradiometer calcs\r\n* [x] Add sensor imbalance weights to gradiometer calcs and calibration coeffs to magnetometer calcs\r\n* [x] Add tests for most/all of the above\r\n\r\nThis will require an update of the mne-testing-dataset","created_at":"2015-07-31T22:09:37Z","updated_at":"2015-08-10T13:47:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7d782a9564ea82f0dff282733dbb876e58f3c5d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374/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/2374/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/d0e0d2fa959ac9e624139823822de7ada9fc9208","head":{"label":"wronk:sss_fine_cal","ref":"sss_fine_cal","sha":"d0e0d2fa959ac9e624139823822de7ada9fc9208","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-07T23:54:49Z","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":80676,"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":"b8b6b0f89749339cd8f7fdae21519b1d05cd3b6b","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-03T16:02:32Z","pushed_at":"2015-08-10T12:28: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":181279,"stargazers_count":141,"watchers_count":141,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":195,"forks":137,"open_issues":195,"watchers":141,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/2374"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/2374"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/2374/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2374/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/2374/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/d0e0d2fa959ac9e624139823822de7ada9fc9208"}}}}