def readstatsfile(filepath):
    """
    read a stats file and return data
    
    input: path to stats file
    output: dict {(t1, t2): [ave, stddev, N, sqsum, sumsqares]
    """
    
    data = open(filepath).readlines()
    
    results = {}
    # skip header line:
    for line in data[1:]:
        line = line.strip()
        items = [float(x) for x in line.split()]
        # to normalize the time intervals, use string formatting to
        #   truncate (not round) to tenths of a second:
        t1 = "%.1f" % items[0]
        t2 = "%.1f" % items[1]
        results[t1, t2] = items[2:]
    
    return results
    
    # end readstatsfile()