def read_marks_data(path, rate, wave_length):
    """
    Read marks file.
    :param path:
        marks file path(containing time of gci).
    :param rate:
        sampling rate.
    :param wave_length:
        wave length.
    :return:
        an list containing the index(time * rate) of gci.
    """
    marks = list()
    with open(path) as mark_file:
        while 1:
            lines = mark_file.readlines(10000)
            if not lines:
                break
            marks.extend(map(lambda l: round(float(l) * rate), lines))
    if marks[-1] == wave_length:
        return marks[:-2]
    return marks