def _fit_dipoles(fun, min_dist_to_inner_skull, data, times, guess_rrs, guess_data, fwd_data, whitener, proj_op, ori, n_jobs):
 from scipy.optimize import fmin_cobyla
 (parallel, p_fun, _) = parallel_func(fun, n_jobs)
 res = parallel((p_fun(min_dist_to_inner_skull, B, t, guess_rrs, guess_data, fwd_data, whitener, proj_op, fmin_cobyla, ori) for (B, t) in zip(data.T, times)))
 pos = np.array([r[0] for r in res])
 amp = np.array([r[1] for r in res])
 ori = np.array([r[2] for r in res])
 gof = (np.array([r[3] for r in res]) * 100)
 residual = np.array([r[4] for r in res]).T
 return (pos, amp, ori, gof, residual)

def _fit_dipoles ( fun , min_dist_to_inner_skull , data , times , guess_rrs , guess_data , fwd_data , whitener , proj_op , ori , n_jobs ) : from scipy . optimize import fmin_cobyla ( parallel , p_fun , _ ) = parallel_func ( fun , n_jobs ) res = parallel ( ( p_fun ( min_dist_to_inner_skull , B , t , guess_rrs , guess_data , fwd_data , whitener , proj_op , fmin_cobyla , ori ) for ( B , t ) in zip ( data . T , times ) ) ) pos = np . array ( [ r [ 0 ] for r in res ] ) amp = np . array ( [ r [ 1 ] for r in res ] ) ori = np . array ( [ r [ 2 ] for r in res ] ) gof = ( np . array ( [ r [ 3 ] for r in res ] ) * 100 ) residual = np . array ( [ r [ 4 ] for r in res ] ) . T return ( pos , amp , ori , gof , residual )
fit a single dipole to the given whitened .