Esempio n. 1
0
 def setUp(self):
     warnings.filterwarnings('ignore')
     self.data_path = self.create_tempfile_from_testdata()
     self.data = tables.open_file(self.data_path, 'a')
     self.proc = process_events.ProcessEventsWithLINT(self.data,
                                                      DATA_GROUP,
                                                      progress=False)
Esempio n. 2
0
def main():
    # Create bogus data file
    data = tables.open_file('test.h5', 'w')
    data.create_array('/', 'events', np.arange(10))

    # Create bogus trace
    trace = np.arange(0, 150)
    trace *= 10
    trace += 5

    # Get timings from trace
    process = process_events.ProcessEvents(data, '/')
    t0 = process._reconstruct_time_from_trace(trace, 0.)
    process = process_events.ProcessEventsWithLINT(data, '/')
    t1 = process._reconstruct_time_from_trace(trace, 0.)
    t0 /= 2.5e-9
    t1 /= 2.5e-9
    print t0, t1

    # Assertions
    assert abs(t0 - 2.0) < 1e-6
    assert abs(t1 - 1.5) < 1e-6