def split_x0(func):
    """
    Wrapper that splits array x0 of the minimization routine into two arrays.

    Splits the the first argument x0 into two arrays alpha_i and tau_i and 
    forwards both arrays to the called function. A single array x0 is necessary 
    to optimize both alpha_i and tau_i at the same time. However, typically, 
    only alpha_i is optimized and tau_i is kept constant. This wrapper allows 
    to use the same function in both scenarios.

    Parameters
    ----------
    func : function
        Function that calculates least squares residual.

    Returns
    -------
    split : function

    See also
    --------
    prony.ls_res : Function to be wrapped during minimization of Prony terms.
    """
    def split(*args):
        alpha_i = args[0][0:int(args[0].shape[0]/2)]
        tau_i = args[0][int(args[0].shape[0]/2):]
        return func(alpha_i, tau_i, args[1], args[2])
    return split