def _create_eeg_el(ch, t=None):
 if (ch['kind'] != FIFF.FIFFV_EEG_CH):
  raise RuntimeError(('%s is not an EEG channel. Cannot create an electrode definition.' % ch['ch_name']))
 if (t is None):
  t = Transform('head', 'head')
 if (t.from_str != 'head'):
  raise RuntimeError('Inappropriate coordinate transformation')
 r0ex = _loc_to_eeg_loc(ch['loc'])
 if (r0ex.shape[1] == 1):
  w = np.array([1.0])
 else:
  w = np.array([1.0, (-1.0)])
 r0ex = apply_trans(t['trans'], r0ex.T)
 cosmag = r0ex.copy()
 _normalize_vectors(cosmag)
 res = dict(chname=ch['ch_name'], coil_class=FIFF.FWD_COILC_EEG, w=w, accuracy=_accuracy_dict['normal'], type=ch['coil_type'], coord_frame=t['to'], rmag=r0ex, cosmag=cosmag)
 return res

def _create_eeg_el ( ch , t = None ) : if ( ch [ 'kind' ] != FIFF . FIFFV_EEG_CH ) : raise RuntimeError ( ( '%s is not an EEG channel. Cannot create an electrode definition.' % ch [ 'ch_name' ] ) ) if ( t is None ) : t = Transform ( 'head' , 'head' ) if ( t . from_str != 'head' ) : raise RuntimeError ( 'Inappropriate coordinate transformation' ) r0ex = _loc_to_eeg_loc ( ch [ 'loc' ] ) if ( r0ex . shape [ 1 ] == 1 ) : w = np . array ( [ 1.0 ] ) else : w = np . array ( [ 1.0 , ( - 1.0 ) ] ) r0ex = apply_trans ( t [ 'trans' ] , r0ex . T ) cosmag = r0ex . copy ( ) _normalize_vectors ( cosmag ) res = dict ( chname = ch [ 'ch_name' ] , coil_class = FIFF . FWD_COILC_EEG , w = w , accuracy = _accuracy_dict [ 'normal' ] , type = ch [ 'coil_type' ] , coord_frame = t [ 'to' ] , rmag = r0ex , cosmag = cosmag ) return res
create an electrode definition .