monitor — Online monitoring#

This module contains some initial prototypes of online monitoring facilities.

Warning

This module is still experimental and interfaces might change.

Module documentation#

Online monitoring.

class astropix_analysis.monitor.AbstractMonitor(readout_class: type, group: str = '127.0.0.1', port: int = 5007)[source]#

Abstract base class for online monitoring applications.

Warning

Note this is very rudimentary, and the (rough) result is achieved with no other GUI facility than the matplotlib canvas. In the future we almost certainly will want to do this properly, but in the meantime this class provides a sensible base building block for simple online monitoring applications.

Parameters:
  • readout_class (type) – The type of readout objects we are expecting (e.g., AstroPix4Readout`).

  • group (str) – The multicast group.

  • port (int) – The multicast port.

create_canvas(**kwargs)[source]#

Create the matplotlib canvas that will hold the monitoring plot.

Note we are adding a row at the very top of the subplots that we are taking over to use it as a message dashboard.

Parameters:

kwargs (dict) – Any keyword argument accepted by plt.subplot().

display_message(x, y, text, **kwargs) None[source]#

Display a message.

_listen() None[source]#

Listening function to be started on a separate thread.

Note the leading underscore—this is generally not intended to be called directly.

start_listening() None[source]#

Start listening for readouts over the UDP socket on a new thread.

start(refresh_interval: float = 0.5, update_pause: float = 0.005)[source]#

Start the monitoring.

This means that we start listening to the UDP socket on a new thread, and we begin popping readouts from the underlying buffer and updating the display.

Parameters:
  • refresh_interval (float) – The plot refresh interval in s.

  • update_pause (float) – The post-update pause, in s, at the end of the update.

setup() None[source]#

Setup the monitor.

This is a general placeholder for the operations that need to be performed each time the monitor in restarted.

abstractmethod process_readout(readout: AbstractAstroPixReadout) None[source]#

Process a single readout.

abstractmethod update_display() None[source]#

Update the matplotlib display.

_abc_impl = <_abc._abc_data object>#
class astropix_analysis.monitor.AstroPix4SimpleMonitor(group: str = '127.0.0.1', port: int = 5007)[source]#

Simple monitor for Astropix 4 readouts.

NUM_COLS = 16#
NUM_ROWS = 35#
process_readout(readout: AbstractAstroPixReadout)[source]#

Overloaded method.

update_display() None[source]#

Overloaded method.

_abc_impl = <_abc._abc_data object>#