Skip to content

ECDC-3728 ev44 writer should skip writes if events array is empty

Daniel Cacabelos requested to merge ECDC-3728_handle_message_with_no_events into main

Issue

ECDC-3728 The ev44 schema supports sending pulse times but leaving empty the pixel_id or time_of_flight arrays that describe neutron events. This is expected to be either because:

  • The pixel_id are implicit and left empty. For example a beam monitor with a single pixel.
    • In this case time_of_flight must be present
  • The hardware has detected no events, but we still want to push the pulse_time to Kafka as a form of "heart beat".
    • In this case time_of_flight is also empty.

The file-writer ev44 module is focused on writing NXevent_data groups, so it makes little sense to add pulse_times where no events were recorded. In this PR we skip the writing of any data (pulse_times) if time_of_flight is empty (meaning no events are being communicated by the given flatbuffer message).

We have improved the documentation of the ev44 schema to clarify the issue addressed by this PR: https://github.com/ess-dmsc/streaming-data-types/pull/94

Description of work

We do not write pulse_time or any other data if the array of time_of_flight array is empty.

Checklist

  • Changes have been documented in changes.md
  • Documentation has been updated in documentation directory
Edited by Daniel Cacabelos

Merge request reports