Test Maxwell filter regularization.
()
| 912 | @pytest.mark.slowtest |
| 913 | @testing.requires_testing_data |
| 914 | def test_regularization(): |
| 915 | """Test Maxwell filter regularization.""" |
| 916 | # Load testing data (raw, SSS std origin, SSS non-standard origin) |
| 917 | min_tols = (20.0, 2.6, 1.0) |
| 918 | med_tols = (200.0, 21.0, 3.7) |
| 919 | origins = ((0.0, 0.0, 0.04), (0.0,) * 3, (0.0, 0.02, 0.02)) |
| 920 | coord_frames = ("head", "meg", "head") |
| 921 | raw_fnames = (raw_fname, erm_fname, sample_fname) |
| 922 | sss_fnames = (sss_reg_in_fname, sss_erm_reg_in_fname, sss_samp_reg_in_fname) |
| 923 | comp_tols = [0, 1, 4] |
| 924 | for ii, rf in enumerate(raw_fnames): |
| 925 | raw = read_crop(rf, (0.0, 1.0)) |
| 926 | sss_reg_in = read_crop(sss_fnames[ii]) |
| 927 | |
| 928 | # Test "in" regularization |
| 929 | raw_sss = maxwell_filter(raw, coord_frame=coord_frames[ii], origin=origins[ii]) |
| 930 | assert_meg_snr(raw_sss, sss_reg_in, min_tols[ii], med_tols[ii], msg=rf) |
| 931 | |
| 932 | # check components match |
| 933 | _check_reg_match(raw_sss, sss_reg_in, comp_tols[ii]) |
| 934 | |
| 935 | |
| 936 | def _check_reg_match(sss_py, sss_mf, comp_tol): |
nothing calls this directly
no test coverage detected