def _bem_find_surface(bem, id_):
 if isinstance(id_, string_types):
  name = id_
  id_ = _surf_dict[id_]
 else:
  name = _bem_explain_surface(id_)
 idx = np.where((np.array([s['id'] for s in bem['surfs']]) == id_))[0]
 if (len(idx) != 1):
  raise RuntimeError(('BEM model does not have the %s triangulation' % name.replace('_', ' ')))
 return bem['surfs'][idx[0]]

def _bem_find_surface ( bem , id_ ) : if isinstance ( id_ , string_types ) : name = id_ id_ = _surf_dict [ id_ ] else : name = _bem_explain_surface ( id_ ) idx = np . where ( ( np . array ( [ s [ 'id' ] for s in bem [ 'surfs' ] ] ) == id_ ) ) [ 0 ] if ( len ( idx ) != 1 ) : raise RuntimeError ( ( 'BEM model does not have the %s triangulation' % name . replace ( '_' , ' ' ) ) ) return bem [ 'surfs' ] [ idx [ 0 ] ]
find surface from already-loaded bem .