streaming_data_types/eventdata_ev43.py
def serialise_ev43(
    source_name, message_id, pulse_time, pulse_index, time_of_flight, detector_id
):
    """
    Serialise event data as an ev43 FlatBuffers message.

    :param source_name:
    :param message_id:
    :param pulse_time:
    :param pulse_index:
    :param time_of_flight:
    :param detector_id:
    :return:
    """
    builder = flatbuffers.Builder(1024)
    builder.ForceDefaults(True)

    source = builder.CreateString(source_name)

    pulse_ts_data = builder.CreateNumpyVector(np.asarray(pulse_time).astype(np.uint64))
    pulse_ix_data = builder.CreateNumpyVector(np.asarray(pulse_index).astype(np.uint32))
    tof_data = builder.CreateNumpyVector(np.asarray(time_of_flight).astype(np.uint32))
    det_data = builder.CreateNumpyVector(np.asarray(detector_id).astype(np.uint32))

    # Build the actual buffer
    Event43Message.Event43MessageStart(builder)
    Event43Message.Event43MessageAddPulseTime(builder, pulse_ts_data)
    Event43Message.Event43MessageAddPulseIndex(builder, pulse_ix_data)
    Event43Message.Event43MessageAddDetectorId(builder, det_data)
    Event43Message.Event43MessageAddTimeOfFlight(builder, tof_data)
    Event43Message.Event43MessageAddMessageId(builder, message_id)
    Event43Message.Event43MessageAddSourceName(builder, source)

    data = Event43Message.Event43MessageEnd(builder)

    builder.Finish(data, file_identifier=FILE_IDENTIFIER)
    return bytes(builder.Output())

    Serialise event data as an ev43 FlatBuffers message.

    :param source_name:
    :param message_id:
    :param pulse_time:
    :param pulse_index:
    :param time_of_flight:
    :param detector_id:
    :return:
    
Serialise event data as an ev43 FlatBuffers message.
Serialise event data as an ev43 FlatBuffers message .
def serialise_ev43(
    source_name, message_id, pulse_time, pulse_index, time_of_flight, detector_id
):
    builder = flatbuffers.Builder(1024)
    builder.ForceDefaults(True)
    source = builder.CreateString(source_name)
    pulse_ts_data = builder.CreateNumpyVector(np.asarray(pulse_time).astype(np.uint64))
    pulse_ix_data = builder.CreateNumpyVector(np.asarray(pulse_index).astype(np.uint32))
    tof_data = builder.CreateNumpyVector(np.asarray(time_of_flight).astype(np.uint32))
    det_data = builder.CreateNumpyVector(np.asarray(detector_id).astype(np.uint32))
    Event43Message.Event43MessageStart(builder)
    Event43Message.Event43MessageAddPulseTime(builder, pulse_ts_data)
    Event43Message.Event43MessageAddPulseIndex(builder, pulse_ix_data)
    Event43Message.Event43MessageAddDetectorId(builder, det_data)
    Event43Message.Event43MessageAddTimeOfFlight(builder, tof_data)
    Event43Message.Event43MessageAddMessageId(builder, message_id)
    Event43Message.Event43MessageAddSourceName(builder, source)
    data = Event43Message.Event43MessageEnd(builder)
    builder.Finish(data, file_identifier=FILE_IDENTIFIER)
    return bytes(builder.Output())
def serialise_ev43 ( source_name , message_id , pulse_time , pulse_index , time_of_flight , detector_id ) : builder = flatbuffers . Builder ( 1024 ) builder . ForceDefaults ( True ) source = builder . CreateString ( source_name ) pulse_ts_data = builder . CreateNumpyVector ( np . asarray ( pulse_time ) . astype ( np . uint64 ) ) pulse_ix_data = builder . CreateNumpyVector ( np . asarray ( pulse_index ) . astype ( np . uint32 ) ) tof_data = builder . CreateNumpyVector ( np . asarray ( time_of_flight ) . astype ( np . uint32 ) ) det_data = builder . CreateNumpyVector ( np . asarray ( detector_id ) . astype ( np . uint32 ) ) Event43Message . Event43MessageStart ( builder ) Event43Message . Event43MessageAddPulseTime ( builder , pulse_ts_data ) Event43Message . Event43MessageAddPulseIndex ( builder , pulse_ix_data ) Event43Message . Event43MessageAddDetectorId ( builder , det_data ) Event43Message . Event43MessageAddTimeOfFlight ( builder , tof_data ) Event43Message . Event43MessageAddMessageId ( builder , message_id ) Event43Message . Event43MessageAddSourceName ( builder , source ) data = Event43Message . Event43MessageEnd ( builder ) builder . Finish ( data , file_identifier = FILE_IDENTIFIER ) return bytes ( builder . Output ( ) )
Serialise event data as an ev43 FlatBuffers message.
Serialise event data as an ev43 FlatBuffers message .
"""
    Serialise event data as an ev43 FlatBuffers message.

    :param source_name:
    :param message_id:
    :param pulse_time:
    :param pulse_index:
    :param time_of_flight:
    :param detector_id:
    :return:
    """ # Build the actual buffer
None
source_name
None
message_id
None
pulse_time
None
pulse_index
None
time_of_flight
None
detector_id
None