def _spark_calc_timestamps_chunk(chunk_index, timestamps):
    """
    Compute the period intervals of the Timeseries

    If there is no intervals, the "intervals" field will be []

    :param chunk_index: identifier of the processed chunk
    :type chunk_index: int

    :param timestamps: the timestamps list (ms since EPOCH)
    :type timestamps: np.array

    :return: index of chunk + associated intervals
    :rtype: list
    """

    # The chunk size is small enough to use the power of NumPy to compute intervals
    intervals_list = list(timestamps[1:] - timestamps[:-1])

    return chunk_index, {
        "sd": timestamps[0],
        "ed": timestamps[-1],
        "intervals": intervals_list
    }