def pearson7(x, a0, a1, a2, a3):
    """compute a Peason7 peak

    Inputs
    ------
    x : ndarray
        the positions at which the signal should be sampled
    a0, a1, a2, a3 : float or ndarrays of size equal to x.shape
        parameters of the Pearson7 equation

    Returns
    -------
    out : ndarray
        the signal

    Remarks
    -------
    Formula is a0 * (1/ ( (1 + ((x-a1)/a2))**2 * (2**(1/a3) -1))**a3
    """
    return a0 / (1.0 + ((x - a1) / a2) ** 2.0 * (2.0 ** (1.0 / a3) - 1.0)
        ) ** a3
