Exemplo n.º 1
0
def generate_data(source, message_id, num_points):
    tofs, dets = generate_fake_data(TOF_RANGE, DET_RANGE, num_points)

    time_stamp = time_in_ns()

    data = serialise_ev42(source, message_id, time_stamp, tofs, dets)
    return time_stamp, data
Exemplo n.º 2
0
def generate_dethist_data(source, message_id, num_points):
    dets = []

    for h in range(DET_HEIGHT):
        _, new_dets = generate_fake_data(TOF_RANGE, (0, DET_WIDTH), num_points)
        for det in new_dets:
            dets.append(h * DET_WIDTH + det)

    time_stamp = time_in_ns()

    data = serialise_ev42(source, message_id, time_stamp, [], dets)
    return time_stamp, data
Exemplo n.º 3
0
    def _generate_dethist_data(self):
        dets = []

        for h in range(self.height):
            _, new_dets = generate_fake_data(
                self.tof_range, (0, self.width), self.num_events
            )
            for det in new_dets:
                dets.append(h * self.width + det)
        data = EventData(
            "simulator", 0, math.floor(time.time() * 10 ** 9), [], dets, None
        )
        return [(int(time.time() * self.num_events), 0, data)]
Exemplo n.º 4
0
 def _generate_data(self):
     tofs, dets = generate_fake_data(self.tof_range, self.det_range, self.num_events)
     data = EventData(
         "simulator", 0, math.floor(time.time() * 10 ** 9), tofs, dets, None
     )
     return [(int(time.time() * self.num_events), 0, data)]
Exemplo n.º 5
0
def generate_data(msg_id, time_stamp, num_events):
    tofs, dets = generate_fake_data(TOF_RANGE, DET_RANGE, num_events)
    return serialise_ev42("system test", msg_id, time_stamp, tofs, dets)