def remove_outliers(ps):
    """
    Removes points that are greater than 10% away from their surrounding two
    points.

    Parameters
    ----------
    ps : numpy.ndarray
        The points to process.

    Returns
    -------
    ps : numpy.ndarray
        The points without outliers.
    """
    for i in range(1,len(ps) - 1):
        a = ps[i-1];
        b = ps[i];
        c = ps[i+1];
        
        #Calculate mean of two surrounding points
        m = (a+c) / 2;
        ad = abs(a - m);
        bd = abs(b - m);
        cd = abs(c - m);
        
        #Replaces point with mean if it's an outlier
        if ad < m * 0.1 and cd < m * 0.1 and bd > m * 0.1:
            ps[i] = m;
            
    return ps;