def correct_jumps_between_arr(arr1, arr2, jump_quantum):
    """
    Shift the start value of one array to align with the end value of another.

    Parameters
    ----------
    arr1 : numpy.ndarray
        Nx0 array of values in the trajectory of some variable.
    arr2 : numpy.ndarray
        Mx0 array of values in the trajectory of some variable. The function
        will shift all values in this array such that its start aligns with the
        end of arr1.

    jump_quantum : float
        The shift added to arr2 will be an integer multiple of this
        jump_quantum size.

    Returns
    -------
    np.ndarray
        Mx0 array of shifted arr2 values.
    """
    jump = arr2[0] - arr1[-1]
    n = round(jump/jump_quantum)
    # correct the elements following the jump
    arr2 -= n * jump_quantum
    return arr2