def _assert_complete_surface(surf):
 from .source_space import _get_solids
 tot_angle = 0.0
 cm = surf['rr'].mean(axis=0)
 logger.info(('%s CM is %6.2f %6.2f %6.2f mm' % (_surf_name[surf['id']], (1000 * cm[0]), (1000 * cm[1]), (1000 * cm[2]))))
 tot_angle = _get_solids(surf['rr'][surf['tris']], cm[np.newaxis, :])[0]
 if (np.abs(((tot_angle / (2 * np.pi)) - 1.0)) > 1e-05):
  raise RuntimeError(('Surface %s is not complete (sum of solid angles = %g * 4*PI instead).' % (_surf_name[surf['id']], tot_angle)))

def _assert_complete_surface ( surf ) : from . source_space import _get_solids tot_angle = 0.0 cm = surf [ 'rr' ] . mean ( axis = 0 ) logger . info ( ( '%s CM is %6.2f %6.2f %6.2f mm' % ( _surf_name [ surf [ 'id' ] ] , ( 1000 * cm [ 0 ] ) , ( 1000 * cm [ 1 ] ) , ( 1000 * cm [ 2 ] ) ) ) ) tot_angle = _get_solids ( surf [ 'rr' ] [ surf [ 'tris' ] ] , cm [ np . newaxis , : ] ) [ 0 ] if ( np . abs ( ( ( tot_angle / ( 2 * np . pi ) ) - 1.0 ) ) > 1e-05 ) : raise RuntimeError ( ( 'Surface %s is not complete (sum of solid angles = %g * 4*PI instead).' % ( _surf_name [ surf [ 'id' ] ] , tot_angle ) ) )
check the sum of solid angles as seen from inside .