def optimize_distortion(points, ns, maxfev=1000, verbose=False):
    """Optimize distortions.

    The orders in the list ns are first fitted subsequently and the result is refined in a final fit simultaneously fitting all orders.

    Parameters
    ----------
        points : np.ndarray
            Points to optimize to (in polar coords).
        ns : tuple
            List of orders to correct for.
        maxfev : int
            Max number of iterations forwarded to scipy.optimize.leastsq().
        verbose : bool
            Set for verbose output.

    Returns
    -------
        : np.ndarray
            Optimized parameters according to ns.
    """