def deriv_series(A, t):
    """ Derivates A with respect to t. """
    [n, nt] = A.shape
    dAdt = (A[:, 2:nt] - A[:, 0:nt - 2]) / (t[2:nt] - t[0:nt - 2])
    tm = (t[0:nt - 2] + t[2:nt]) / 2.0
    return dAdt, tm
