def test_ch_loc():
 raw_py = read_raw_kit(sqd_path, mrk_path, elp_txt_path, hsp_txt_path, stim='<')
 raw_bin = read_raw_fif(op.join(data_dir, 'test_bin_raw.fif'))
 ch_py = raw_py._raw_extras[0]['sensor_locs'][:, :5]
 ch_py[:, :3] *= 1000.0
 ch_sns = read_sns(op.join(data_dir, 'sns.txt'))
 assert_array_almost_equal(ch_py, ch_sns, 2)
 assert_array_almost_equal(raw_py.info['dev_head_t']['trans'], raw_bin.info['dev_head_t']['trans'], 4)
 for (py_ch, bin_ch) in zip(raw_py.info['chs'], raw_bin.info['chs']):
  if bin_ch['ch_name'].startswith('MEG'):
   assert_array_almost_equal(py_ch['loc'], bin_ch['loc'], decimal=2)
 mrks = [mrk_path, mrk2_path, mrk3_path]
 read_raw_kit(sqd_path, mrks, elp_txt_path, hsp_txt_path, preload=False)
 raw_bin.info['dig'] = raw_bin.info['dig'][:8]
 raw_py.info['dig'] = raw_py.info['dig'][:8]
 assert_dig_allclose(raw_py.info, raw_bin.info)

def test_ch_loc ( ) : raw_py = read_raw_kit ( sqd_path , mrk_path , elp_txt_path , hsp_txt_path , stim = '<' ) raw_bin = read_raw_fif ( op . join ( data_dir , 'test_bin_raw.fif' ) ) ch_py = raw_py . _raw_extras [ 0 ] [ 'sensor_locs' ] [ : , : 5 ] ch_py [ : , : 3 ] *= 1000.0 ch_sns = read_sns ( op . join ( data_dir , 'sns.txt' ) ) assert_array_almost_equal ( ch_py , ch_sns , 2 ) assert_array_almost_equal ( raw_py . info [ 'dev_head_t' ] [ 'trans' ] , raw_bin . info [ 'dev_head_t' ] [ 'trans' ] , 4 ) for ( py_ch , bin_ch ) in zip ( raw_py . info [ 'chs' ] , raw_bin . info [ 'chs' ] ) : if bin_ch [ 'ch_name' ] . startswith ( 'MEG' ) : assert_array_almost_equal ( py_ch [ 'loc' ] , bin_ch [ 'loc' ] , decimal = 2 ) mrks = [ mrk_path , mrk2_path , mrk3_path ] read_raw_kit ( sqd_path , mrks , elp_txt_path , hsp_txt_path , preload = False ) raw_bin . info [ 'dig' ] = raw_bin . info [ 'dig' ] [ : 8 ] raw_py . info [ 'dig' ] = raw_py . info [ 'dig' ] [ : 8 ] assert_dig_allclose ( raw_py . info , raw_bin . info )
test raw kit loc .