@verbose
def make_eeg_average_ref_proj(info, activate=True, verbose=None):
 if info.get('custom_ref_applied', False):
  raise RuntimeError('A custom reference has been applied to the data earlier. Please use the mne.io.set_eeg_reference function to move from one EEG reference to another.')
 logger.info('Adding average EEG reference projection.')
 eeg_sel = pick_types(info, meg=False, eeg=True, ref_meg=False, exclude='bads')
 ch_names = info['ch_names']
 eeg_names = [ch_names[k] for k in eeg_sel]
 n_eeg = len(eeg_sel)
 if (n_eeg == 0):
  raise ValueError('Cannot create EEG average reference projector (no EEG data found)')
 vec = np.ones((1, n_eeg))
 vec /= n_eeg
 explained_var = None
 eeg_proj_data = dict(col_names=eeg_names, row_names=None, data=vec, nrow=1, ncol=n_eeg)
 eeg_proj = Projection(active=activate, data=eeg_proj_data, desc='Average EEG reference', kind=FIFF.FIFFV_MNE_PROJ_ITEM_EEG_AVREF, explained_var=explained_var)
 return eeg_proj

@ verbose def make_eeg_average_ref_proj ( info , activate = True , verbose = None ) : if info . get ( 'custom_ref_applied' , False ) : raise RuntimeError ( 'A custom reference has been applied to the data earlier. Please use the mne.io.set_eeg_reference function to move from one EEG reference to another.' ) logger . info ( 'Adding average EEG reference projection.' ) eeg_sel = pick_types ( info , meg = False , eeg = True , ref_meg = False , exclude = 'bads' ) ch_names = info [ 'ch_names' ] eeg_names = [ ch_names [ k ] for k in eeg_sel ] n_eeg = len ( eeg_sel ) if ( n_eeg == 0 ) : raise ValueError ( 'Cannot create EEG average reference projector (no EEG data found)' ) vec = np . ones ( ( 1 , n_eeg ) ) vec /= n_eeg explained_var = None eeg_proj_data = dict ( col_names = eeg_names , row_names = None , data = vec , nrow = 1 , ncol = n_eeg ) eeg_proj = Projection ( active = activate , data = eeg_proj_data , desc = 'Average EEG reference' , kind = FIFF . FIFFV_MNE_PROJ_ITEM_EEG_AVREF , explained_var = explained_var ) return eeg_proj
create an eeg average reference ssp projection vector .