def compute_xdot(data, dt):
    """Compute xdot for a chunk of snapshots.

    Parameters
    ----------
    data : (Nfull, n_samples) ndarray
        The dataset. Here Nfull = numvariable*38523.
    dt : float
        The timestep size

    Returns
    -------
    xdot : (Nfull, n_samples-4) ndarray
        Time derivative of data using 4th order 5 point stecil approximation.
        See https://en.wikipedia.org/wiki/Five-point_stencil. No derivative is
        computed for first 2 and last 2 timesteps due to the stencil.
    """

    xdot = (data[:,0:-4] - 8*data[:,1:-3] + 8*data[:,3:-1] - data[:,4:])/(12*dt)
    return xdot