def couple_track(cell_list, max_ID, mintrack):
    """
    The coupled cell tracks are re-arranged from the list of cells sorted by time, to
    a list of tracks sorted by ID. Tracks shorter than mintrack are rejected.
    """
    track_list = []
    for n in range(1, max_ID):
        cell_track = pd.DataFrame(
            data=None,
            index=None,
            columns=["ID", "time", "x", "y", "cen_x", "cen_y", "max_ref", "cont"],
        )
        cell_track = []
        for t in range(len(cell_list)):
            mytime = cell_list[t]
            cell_track.append(mytime[mytime.ID == n])
        cell_track = pd.concat(cell_track, axis=0)

        if len(cell_track) < mintrack:
            continue
        track_list.append(cell_track)
    return track_list
The coupled cell tracks are re-arranged from the list of cells sorted by time, to
a list of tracks sorted by ID. Tracks shorter than mintrack are rejected.
pysteps/tracking/tdating.py