def Spline(y,xi):
    """
    Spline
    Description: Given 4 y values and a xi point, calculate the value at the xi point.
    Parameters:
    y - numpy array with 4 values from the 4 nearest grid points
    xi - index at which the interpolation is occurring.
    Returns: yi - the interpolated value
    """
    return 0.5*((2*y[1])+(y[2]-y[0])*xi+(-y[3]+4*y[2]-5*y[1]+2*y[0])*xi**2+(y[3]-3*y[2]+3*y[1]-y[0])*xi**3)