def _pick_channels_inverse_operator(ch_names, inv):
 sel = list()
 for name in inv['noise_cov'].ch_names:
  try:
   sel.append(ch_names.index(name))
  except ValueError:
   raise ValueError(('The inverse operator was computed with channel %s which is not present in the data. You should compute a new inverse operator restricted to the good data channels.' % name))
 return sel

def _pick_channels_inverse_operator ( ch_names , inv ) : sel = list ( ) for name in inv [ 'noise_cov' ] . ch_names : try : sel . append ( ch_names . index ( name ) ) except ValueError : raise ValueError ( ( 'The inverse operator was computed with channel %s which is not present in the data. You should compute a new inverse operator restricted to the good data channels.' % name ) ) return sel
data channel indices to be used knowing an inverse operator .