def _do_prim_curr(rr, coils):
 pc = np.empty(((len(rr) * 3), len(coils)))
 for (ci, c) in enumerate(coils):
  pc[:, ci] = np.sum((c['w'] * _bem_inf_fields(rr, c['rmag'], c['cosmag'])), 2).ravel()
 return pc

def _do_prim_curr ( rr , coils ) : pc = np . empty ( ( ( len ( rr ) * 3 ) , len ( coils ) ) ) for ( ci , c ) in enumerate ( coils ) : pc [ : , ci ] = np . sum ( ( c [ 'w' ] * _bem_inf_fields ( rr , c [ 'rmag' ] , c [ 'cosmag' ] ) ) , 2 ) . ravel ( ) return pc
calculate primary currents in a set of meg coils .