def _get_ecg_channel_index(ch_name, inst):
 if (ch_name is None):
  ecg_idx = pick_types(inst.info, meg=False, eeg=False, stim=False, eog=False, ecg=True, emg=False, ref_meg=False, exclude='bads')
 else:
  if (ch_name not in inst.ch_names):
   raise ValueError(('%s not in channel list (%s)' % (ch_name, inst.ch_names)))
  ecg_idx = pick_channels(inst.ch_names, include=[ch_name])
 if (len(ecg_idx) == 0):
  return None
 if (len(ecg_idx) > 1):
  warn(('More than one ECG channel found. Using only %s.' % inst.ch_names[ecg_idx[0]]))
 return ecg_idx[0]

def _get_ecg_channel_index ( ch_name , inst ) : if ( ch_name is None ) : ecg_idx = pick_types ( inst . info , meg = False , eeg = False , stim = False , eog = False , ecg = True , emg = False , ref_meg = False , exclude = 'bads' ) else : if ( ch_name not in inst . ch_names ) : raise ValueError ( ( '%s not in channel list (%s)' % ( ch_name , inst . ch_names ) ) ) ecg_idx = pick_channels ( inst . ch_names , include = [ ch_name ] ) if ( len ( ecg_idx ) == 0 ) : return None if ( len ( ecg_idx ) > 1 ) : warn ( ( 'More than one ECG channel found. Using only %s.' % inst . ch_names [ ecg_idx [ 0 ] ] ) ) return ecg_idx [ 0 ]
get ecg channel index .