@slow_test
@testing.requires_testing_data
def test_regularization():
 min_tols = (100.0, 2.6, 1.0)
 med_tols = (1000.0, 21.4, 3.7)
 origins = ((0.0, 0.0, 0.04), ((0.0,) * 3), (0.0, 0.02, 0.02))
 coord_frames = ('head', 'meg', 'head')
 raw_fnames = (raw_fname, erm_fname, sample_fname)
 sss_fnames = (sss_reg_in_fname, sss_erm_reg_in_fname, sss_samp_reg_in_fname)
 comp_tols = [0, 1, 4]
 for (ii, rf) in enumerate(raw_fnames):
  raw = read_crop(rf, (0.0, 1.0))
  sss_reg_in = read_crop(sss_fnames[ii])
  raw_sss = maxwell_filter(raw, coord_frame=coord_frames[ii], origin=origins[ii])
  assert_meg_snr(raw_sss, sss_reg_in, min_tols[ii], med_tols[ii], msg=rf)
  _check_reg_match(raw_sss, sss_reg_in, comp_tols[ii])

@ slow_test @ testing . requires_testing_data def test_regularization ( ) : min_tols = ( 100.0 , 2.6 , 1.0 ) med_tols = ( 1000.0 , 21.4 , 3.7 ) origins = ( ( 0.0 , 0.0 , 0.04 ) , ( ( 0.0 , ) * 3 ) , ( 0.0 , 0.02 , 0.02 ) ) coord_frames = ( 'head' , 'meg' , 'head' ) raw_fnames = ( raw_fname , erm_fname , sample_fname ) sss_fnames = ( sss_reg_in_fname , sss_erm_reg_in_fname , sss_samp_reg_in_fname ) comp_tols = [ 0 , 1 , 4 ] for ( ii , rf ) in enumerate ( raw_fnames ) : raw = read_crop ( rf , ( 0.0 , 1.0 ) ) sss_reg_in = read_crop ( sss_fnames [ ii ] ) raw_sss = maxwell_filter ( raw , coord_frame = coord_frames [ ii ] , origin = origins [ ii ] ) assert_meg_snr ( raw_sss , sss_reg_in , min_tols [ ii ] , med_tols [ ii ] , msg = rf ) _check_reg_match ( raw_sss , sss_reg_in , comp_tols [ ii ] )
test maxwell filter regularization .