MonitoringSource#

class ctapipe.io.monitoringsource.MonitoringSource(**kwargs: Any)[source]#

Bases: TelescopeComponent

Parent class for MonitoringSource.

MonitoringSource read input files and fill ArrayEventContainer instances with corresponding monitoring data based on the event trigger time.

A new MonitoringSource should be created for each type of monitoring file read into ctapipe, e.g. HDF5 files are read by the HDF5MonitoringSource.

MonitoringSource provides a common high-level interface for accessing monitoring information from different data sources. Creating an MonitoringSource for a new file format or other monitoring source ensures that data can be accessed in a common way, regardless of the file format or data origin.

MonitoringSource itself is an abstract class, but will create an appropriate subclass. An MonitoringSource can also be created through the configuration system, by passing config or parent as appropriate. E.g. if using MonitoringSource inside of a Tool, you would do:

>>> self.monitoring_source = MonitoringSource(parent=self) 

Attributes Summary

monitoring_types

The monitoring types provided by this monitoring source

plugin_entry_point

Methods Summary

close()

Close this event source.

fill_monitoring_container(event)

Fill the monitoring container for a given event.

has_any_monitoring_types(monitoring_types)

Check if any of monitoring_types is in self.monitoring_types

Attributes Documentation

monitoring_types#

The monitoring types provided by this monitoring source

Returns:
tuple[ctapipe.io.MonitoringType]
plugin_entry_point = 'ctapipe_monitoring'#

Methods Documentation

close()[source]#

Close this event source.

No-op by default. Should be overridden by sources needing a cleanup-step

abstract fill_monitoring_container(event: ArrayEventContainer)[source]#

Fill the monitoring container for a given event.

Parameters:
eventArrayEventContainer

The event to fill the monitoring container for.

has_any_monitoring_types(monitoring_types) bool[source]#

Check if any of monitoring_types is in self.monitoring_types

Parameters:
monitoring_types: Iterable

Iterable of monitoring types