#NEWLINE# def test_pick_refs( ) : #NEWLINE# #INDENT# 'Test picking of reference sensors\n    ' #NEWLINE# infos = list ( ) #NEWLINE# kit_dir = op . join ( io_dir , 'kit' , 'tests' , 'data' ) #NEWLINE# sqd_path = op . join ( kit_dir , 'test.sqd' ) #NEWLINE# mrk_path = op . join ( kit_dir , 'test_mrk.sqd' ) #NEWLINE# elp_path = op . join ( kit_dir , 'test_elp.txt' ) #NEWLINE# hsp_path = op . join ( kit_dir , 'test_hsp.txt' ) #NEWLINE# raw_kit = read_raw_kit ( sqd_path , mrk_path , elp_path , hsp_path ) #NEWLINE# infos . append ( raw_kit . info ) #NEWLINE# bti_dir = op . join ( io_dir , 'bti' , 'tests' , 'data' ) #NEWLINE# bti_pdf = op . join ( bti_dir , 'test_pdf_linux' ) #NEWLINE# bti_config = op . join ( bti_dir , 'test_config_linux' ) #NEWLINE# bti_hs = op . join ( bti_dir , 'test_hs_linux' ) #NEWLINE# with warnings . catch_warnings ( record = True ) : #NEWLINE# #INDENT# raw_bti = read_raw_bti ( bti_pdf , bti_config , bti_hs , preload = False ) #NEWLINE# #UNINDENT# infos . append ( raw_bti . info ) #NEWLINE# fname_ctf_raw = op . join ( io_dir , 'tests' , 'data' , 'test_ctf_comp_raw.fif' ) #NEWLINE# raw_ctf = Raw ( fname_ctf_raw , compensation = 2 ) #NEWLINE# infos . append ( raw_ctf . info ) #NEWLINE# for info in infos : #NEWLINE# #INDENT# info [ 'bads' ] = [ ] #NEWLINE# assert_raises ( ValueError , pick_types , info , meg = 'foo' ) #NEWLINE# assert_raises ( ValueError , pick_types , info , ref_meg = 'foo' ) #NEWLINE# picks_meg_ref = pick_types ( info , meg = True , ref_meg = True ) #NEWLINE# picks_meg = pick_types ( info , meg = True , ref_meg = False ) #NEWLINE# picks_ref = pick_types ( info , meg = False , ref_meg = True ) #NEWLINE# assert_array_equal ( picks_meg_ref , np . sort ( np . concatenate ( [ picks_meg , picks_ref ] ) ) ) #NEWLINE# picks_grad = pick_types ( info , meg = 'grad' , ref_meg = False ) #NEWLINE# picks_ref_grad = pick_types ( info , meg = False , ref_meg = 'grad' ) #NEWLINE# picks_meg_ref_grad = pick_types ( info , meg = 'grad' , ref_meg = 'grad' ) #NEWLINE# assert_array_equal ( picks_meg_ref_grad , np . sort ( np . concatenate ( [ picks_grad , picks_ref_grad ] ) ) ) #NEWLINE# picks_mag = pick_types ( info , meg = 'mag' , ref_meg = False ) #NEWLINE# picks_ref_mag = pick_types ( info , meg = False , ref_meg = 'mag' ) #NEWLINE# picks_meg_ref_mag = pick_types ( info , meg = 'mag' , ref_meg = 'mag' ) #NEWLINE# assert_array_equal ( picks_meg_ref_mag , np . sort ( np . concatenate ( [ picks_mag , picks_ref_mag ] ) ) ) #NEWLINE# assert_array_equal ( picks_meg , np . sort ( np . concatenate ( [ picks_mag , picks_grad ] ) ) ) #NEWLINE# assert_array_equal ( picks_ref , np . sort ( np . concatenate ( [ picks_ref_mag , picks_ref_grad ] ) ) ) #NEWLINE# assert_array_equal ( picks_meg_ref , np . sort ( np . concatenate ( [ picks_grad , picks_mag , picks_ref_grad , picks_ref_mag ] ) ) ) #NEWLINE# for pick in ( picks_meg_ref , picks_meg , picks_ref , picks_grad , picks_ref_grad , picks_meg_ref_grad , picks_mag , picks_meg , picks_meg_ref_mag ) : #NEWLINE# #INDENT# if ( len ( pick ) > 0 ) : #NEWLINE# #INDENT# pick_info ( info , pick )