def _find_channel_idx(ch_name, params):
 indices = list()
 offset = 0
 labels = [l._text for l in params['fig_selection'].radio.labels]
 for label in labels:
  if (label == 'Custom'):
   continue
  selection = params['selections'][label]
  hits = np.where((np.array(params['raw'].ch_names)[selection] == ch_name))
  for idx in hits[0]:
   indices.append((offset + idx))
  offset += len(selection)
 return indices

def _find_channel_idx ( ch_name , params ) : indices = list ( ) offset = 0 labels = [ l . _text for l in params [ 'fig_selection' ] . radio . labels ] for label in labels : if ( label == 'Custom' ) : continue selection = params [ 'selections' ] [ label ] hits = np . where ( ( np . array ( params [ 'raw' ] . ch_names ) [ selection ] == ch_name ) ) for idx in hits [ 0 ] : indices . append ( ( offset + idx ) ) offset += len ( selection ) return indices
helper for finding all indices when using selections .