#NEWLINE# def _do_cross_dots( intrad , volume , coils1 , coils2 , r0 , ch_type , lut , n_fact ) : #NEWLINE# #INDENT# "Compute lead field dot product integrations between two coil sets.\n\n    The code is a direct translation of MNE-C code found in\n    `mne_map_data/lead_dots.c`.\n\n    Parameters\n    ----------\n    intrad : float\n        The integration radius. It is used to calculate beta as:\n        beta = (intrad * intrad) / (r1 * r2).\n    volume : bool\n        If True, compute volume integral.\n    coils1 : list of dict\n        The original coils.\n    coils2 : list of dict\n        The coils to which data is being mapped.\n    r0 : array, shape (3 x 1).\n        The origin of the sphere.\n    ch_type : str\n        The channel type. It can be 'meg' or 'eeg'\n    lut : callable\n        Look-up table for evaluating Legendre polynomials.\n    n_fact : array\n        Coefficients in the integration sum.\n\n    Returns\n    -------\n    products : array, shape (n_coils, n_coils)\n        The integration products.\n    " #NEWLINE# rmags1 = [ ( coil [ 'rmag' ] - r0 [ np . newaxis , : ] ) for coil in coils1 ] #NEWLINE# rmags2 = [ ( coil [ 'rmag' ] - r0 [ np . newaxis , : ] ) for coil in coils2 ] #NEWLINE# rlens1 = [ np . sqrt ( np . sum ( ( r * r ) , axis = 1 ) ) for r in rmags1 ] #NEWLINE# rlens2 = [ np . sqrt ( np . sum ( ( r * r ) , axis = 1 ) ) for r in rmags2 ] #NEWLINE# rmags1 = [ ( r / rl [ : , np . newaxis ] ) for ( r , rl ) in zip ( rmags1 , rlens1 ) ] #NEWLINE# rmags2 = [ ( r / rl [ : , np . newaxis ] ) for ( r , rl ) in zip ( rmags2 , rlens2 ) ] #NEWLINE# ws1 = [ coil [ 'w' ] for coil in coils1 ] #NEWLINE# ws2 = [ coil [ 'w' ] for coil in coils2 ] #NEWLINE# cosmags1 = [ coil [ 'cosmag' ] for coil in coils1 ] #NEWLINE# cosmags2 = [ coil [ 'cosmag' ] for coil in coils2 ] #NEWLINE# products = np . zeros ( ( len ( rmags1 ) , len ( rmags2 ) ) ) #NEWLINE# for ci1 in range ( len ( coils1 ) ) : #NEWLINE# #INDENT# res = _fast_sphere_dot_r0 ( intrad , rmags1 [ ci1 ] , products , rlens1 [ ci1 ] , rlens2 , cosmags1 [ ci1 ] , cosmags2 , ws1 [ ci1 ] , ws2 , volume , lut , n_fact , ch_type ) #NEWLINE# products [ ci1 , : ] = res #NEWLINE# #UNINDENT# return products