def get_transit_boundary_indices(time, transit_size):
    """ Determines transit boundaries from sorted time of transit cut out
        :param time (1D np.array) sorted times of transit cut out
        :param transit_size (float) size of the transit crop window in days
        :returns tuple:
                        [0] list of transit start indices (int)
                        [1] list of sequence lengths (int) of each transit
    """
    sequence_lengths = []
    transit_start_indices = [0]

    for i, t in enumerate(time):
        if t - time[transit_start_indices[-1]] > transit_size:
            sequence_lengths.append(i - transit_start_indices[-1])
            transit_start_indices.append(i)
    # last length is from last transit start til the end of the array
    sequence_lengths.append(len(time) - transit_start_indices[-1])

    return transit_start_indices, sequence_lengths