'Fit the warp from source points to destination points.
Parameters
source : array, shape (n_src, 3)
The source points.
destination : array, shape (n_dest, 3)
The destination points.
order : int
Order of the spherical harmonic fit.
reg : float
Regularization of the TPS warp.
center : bool
If True, center the points by fitting a sphere to points
that are in a reasonable region for head digitization.
match : str
The uniformly-spaced points to match on the two surfaces.
Can be "ico#" or "oct#" where "#" is an integer.
The default is "oct5".
verbose : bool, str, int, or None
If not None, override default verbose level (see
:func:`mne.verbose` and :ref:`Logging documentation <tut_logging>`
for more).
Returns
inst : instance of SphericalSurfaceWarp
The warping object (for chaining).'

@verbose
def fit(self, source, destination, order=4, reg=1e-05, center=True, match='oct5', verbose=None):

    from .bem import _fit_sphere
    from .source_space import _check_spacing
    match_rr = _check_spacing(match, verbose=False)[2]['rr']
    logger.info('Computing    TPS    warp')
    src_center = dest_center = np.zeros(3)
    if center:
        logger.info('                Centering    data')
        hsp = np.array([p for p in source if (not ((p[2] < (-1e-06)) and (p[1] > 1e-06)))])
        src_center = _fit_sphere(hsp, disp=False)[1]
        source = (source - src_center)
        hsp = np.array([p for p in destination if (not ((p[2] < 0) and (p[1] > 0)))])
        dest_center = _fit_sphere(hsp, disp=False)[1]
        destination = (destination - dest_center)
        logger.info(('                Using    centers    %s    ->    %s' % (np.array_str(src_center, None, 3), np.array_str(dest_center, None, 3))))
    self._fit_params = dict(n_src=len(source), n_dest=len(destination), match=match, n_match=len(match_rr), order=order, reg=reg)
    assert (source.shape[1] == destination.shape[1] == 3)
    self._destination = destination.copy()
    logger.info('                Converting    to    spherical    coordinates')
    src_rad_az_pol = _cart_to_sph(source).T
    dest_rad_az_pol = _cart_to_sph(destination).T
    match_rad_az_pol = _cart_to_sph(match_rr).T
    del match_rr
    logger.info(('                Computing    spherical    harmonic    approximation    with    order    %s' % order))
    src_sph = _compute_sph_harm(order, *src_rad_az_pol[1:])
    dest_sph = _compute_sph_harm(order, *dest_rad_az_pol[1:])
    match_sph = _compute_sph_harm(order, *match_rad_az_pol[1:])
    src_coeffs = linalg.lstsq(src_sph, src_rad_az_pol[0])[0]
    dest_coeffs = linalg.lstsq(dest_sph, dest_rad_az_pol[0])[0]
    logger.info(('                Matching    %d    points    (%s)    on    smoothed    surfaces' % (len(match_sph), match)))
    src_rad_az_pol = match_rad_az_pol.copy()
    src_rad_az_pol[0] = np.abs(np.dot(match_sph, src_coeffs))
    dest_rad_az_pol = match_rad_az_pol.copy()
    dest_rad_az_pol[0] = np.abs(np.dot(match_sph, dest_coeffs))
    source = _sph_to_cart(src_rad_az_pol.T)
    source += src_center
    destination = _sph_to_cart(dest_rad_az_pol.T)
    destination += dest_center
    self._warp = _TPSWarp().fit(source, destination, reg)
    self._matched = np.array([source, destination])
    logger.info('[done]')
    return self
