def _get_data():
 raw = read_raw_fif(raw_fname).crop(0.0, 5.0).load_data()
 data_picks = pick_types(raw.info, meg=True, eeg=True)
 other_picks = pick_types(raw.info, meg=False, stim=True, eog=True)
 picks = np.sort(np.concatenate((data_picks[::16], other_picks)))
 raw = raw.pick_channels([raw.ch_names[p] for p in picks])
 raw.info.normalize_proj()
 ecg = RawArray(np.zeros((1, len(raw.times))), create_info(['ECG 063'], raw.info['sfreq'], 'ecg'))
 for key in ('dev_head_t', 'buffer_size_sec', 'highpass', 'lowpass', 'dig'):
  ecg.info[key] = raw.info[key]
 raw.add_channels([ecg])
 src = read_source_spaces(src_fname)
 trans = read_trans(trans_fname)
 sphere = make_sphere_model('auto', 'auto', raw.info)
 stc = _make_stc(raw, src)
 return (raw, src, stc, trans, sphere)

def _get_data ( ) : raw = read_raw_fif ( raw_fname ) . crop ( 0.0 , 5.0 ) . load_data ( ) data_picks = pick_types ( raw . info , meg = True , eeg = True ) other_picks = pick_types ( raw . info , meg = False , stim = True , eog = True ) picks = np . sort ( np . concatenate ( ( data_picks [ : : 16 ] , other_picks ) ) ) raw = raw . pick_channels ( [ raw . ch_names [ p ] for p in picks ] ) raw . info . normalize_proj ( ) ecg = RawArray ( np . zeros ( ( 1 , len ( raw . times ) ) ) , create_info ( [ 'ECG 063' ] , raw . info [ 'sfreq' ] , 'ecg' ) ) for key in ( 'dev_head_t' , 'buffer_size_sec' , 'highpass' , 'lowpass' , 'dig' ) : ecg . info [ key ] = raw . info [ key ] raw . add_channels ( [ ecg ] ) src = read_source_spaces ( src_fname ) trans = read_trans ( trans_fname ) sphere = make_sphere_model ( 'auto' , 'auto' , raw . info ) stc = _make_stc ( raw , src ) return ( raw , src , stc , trans , sphere )
helper to get the data array .