#NEWLINE# def _map_meg_channels( info_from , info_to , mode = 'fast' , origin = ( 0.0 , 0.0 , 0.04 ) ) : #NEWLINE# #INDENT# "Find mapping from one set of channels to another.\n\n    Parameters\n    ----------\n    info_from : instance of Info\n        The measurement data to interpolate from.\n    info_to : instance of Info\n        The measurement info to interpolate to.\n    mode : str\n        Either `'accurate'` or `'fast'`, determines the quality of the\n        Legendre polynomial expansion used. `'fast'` should be sufficient\n        for most applications.\n\n    Returns\n    -------\n    mapping : array\n        A mapping matrix of shape len(pick_to) x len(pick_from).\n    " #NEWLINE# templates = _read_coil_defs ( verbose = False ) #NEWLINE# coils_from = _create_meg_coils ( info_from [ 'chs' ] , 'normal' , info_from [ 'dev_head_t' ] , templates ) #NEWLINE# coils_to = _create_meg_coils ( info_to [ 'chs' ] , 'normal' , info_to [ 'dev_head_t' ] , templates ) #NEWLINE# miss = 0.0001 #NEWLINE# origin = _check_origin ( origin , info_from ) #NEWLINE# ( int_rad , noise , lut_fun , n_fact ) = _setup_dots ( mode , coils_from , 'meg' ) #NEWLINE# logger . info ( ( '    Computing dot products for %i coils...' % len ( coils_from ) ) ) #NEWLINE# self_dots = _do_self_dots ( int_rad , False , coils_from , coils_to , 'meg' , lut_fun , n_fact , n_jobs = 1 ) #NEWLINE# logger . info ( ( '    Computing cross products for coils %i x %i coils...' % ( len ( coils_from ) , len ( coils_to ) ) ) ) #NEWLINE# cross_dots = _do_cross_dots ( int_rad , False , coils_from , coils_to , origin , 'meg' , lut_fun , n_fact ) . T #NEWLINE# ch_names = [ c [ 'ch_name' ] for c in info_from [ 'chs' ] ] #NEWLINE# fmd = dict ( kind = 'meg' , ch_names = ch_names , origin = origin , noise = noise , self_dots = self_dots , surface_dots = cross_dots , int_rad = int_rad , miss = miss ) #NEWLINE# mapping = _compute_mapping_matrix ( fmd , info_from ) #NEWLINE# return mapping