import csv


def read_timestamps(text_file):
    """
    Read a text file containing the timestamps of images
    and return a dictionary matching the name of the image
    to its timestamp.
    """
    timestamps = {'name': [], 'date': [], 'hour': [],
                  'minute': [], 'time': []}
    with open(text_file, 'r') as csvfile:
        reader = csv.reader(csvfile, delimiter=' ')
        for row in reader:
            timestamps['name'].append(row[0])
            timestamps['date'].append(row[1])
            hour = int(row[2])
            timestamps['hour'].append(hour)
            minute = int(row[3])
            timestamps['minute'].append(minute)
            timestamps['time'].append(hour + minute / 60.)
    return timestamps