def parabolic_fit(Y):
    """Fit a parabola to 3 y values at x=[-1,0,1]; return x0, y0."""
    c = Y[1]
    a = 0.5 * (Y[0] + Y[2]) - Y[1]
    b = 0.5 * (Y[2] - Y[0])
    x0 = -b / (2 * a)
    y0 = - b**2 / (2 * a) + c
    return x0, y0