Ejemplo n.º 1
0
def convert_to_real_time(data, delete_ofls=True):
    """
    Change the event time of each record into the actual time (since starting)
    the measurment, given in ps.
    """
    if len(data) == 0:
        return np.zeros((0, 3), dtype='u8')

    t0 = time.time()
    print '* convert event time to real time... ',
    data = T2_tools.convert_to_real_time_ps(data)
    t1 = time.time() - t0 
    print 'done ({:.2f} s).'.format(t1)
    
    if delete_ofls:
        t0 = time.time()
        print '* delete overflows... ',
        data = np.delete(data, np.where(data[:,1]==63)[0], axis=0)
        t1 = time.time() - t0 
        print 'done ({:.2f} s).'.format(t1)

    return data