def METHOD_NAME(image, guess=(1.,1.,0.,0.,0.,0.), tol=1.e-6):
    """Find the best fitting profile to the given k-space image
    """
    class resid(object):
        def __init__(self, image):
            self._gsp = galsim.GSParams(kvalue_accuracy=1.e-5)
            self._target_image = galsim.ImageCF(image)
            self._scratch_image = galsim.ImageCF(image)
            #self._target_image = galsim.ImageCD(image)
            #self._scratch_image = galsim.ImageCD(image)
        def __call__(self, params):
            if params[0] < 0. or abs(params[2]) > 1. or abs(params[3]) > 1.:
                return 1.e500
            try:
                draw(params, self._scratch_image, gsparams=self._gsp)
            except ValueError:
                return 1.e500
            a = self._scratch_image.array
            a -= self._target_image.array
            a **= 2
            chisq = numpy.sum(numpy.abs(a))
            #print(params,'  ',chisq)
            return chisq
    guess = numpy.array(guess)
    print('guess = ',guess)
    # With float images, the numerical derivatives fail for the default method.
    result = scipy.optimize.minimize(resid(image), guess, tol=tol, method='Nelder-Mead')
    print('result = ',result.x)
    print('number of iterations = ',result.nit)
    print('number of function evals = ',result.nfev)
    return result.x