HistogramAggregator#
- class ctapipe.monitoring.aggregator.HistogramAggregator(*args: t.Any, **kwargs: t.Any)[source]#
Bases:
BaseAggregatorCompute aggregated histograms from a chunk of event-wise data using Hist.
Works with any N-dimensional event-wise data by aggregating along axis=0 (event dimension).
Attributes Summary
Dictionary that contains
class_nameand the corresponding kwargs to construct ahist.axis.<class_name>(**kwargs)instance.List of axis names for the histogram.
Methods Summary
hist_from_container(hist_container)Construct a
hist.Histfrom aChunkHistogramContainer.hist_from_tablerow(row)Build a
hist.Histfrom an Astropy table row produced by theHistogramAggregator.Attributes Documentation
- axis_definition#
Dictionary that contains
class_nameand the corresponding kwargs to construct ahist.axis.<class_name>(**kwargs)instance. E.g.{'class_name': 'Regular', 'bins': 40, 'start': 20.0, 'stop': 80.0, 'name': 'value'}.
- axis_names#
List of axis names for the histogram. E.g. [‘channel’, ‘pixel’]. If None, default names will be used.
Methods Documentation
- static hist_from_container(hist_container: ChunkHistogramContainer)[source]#
Construct a
hist.Histfrom aChunkHistogramContainer.- Parameters:
- hist_containerChunkHistogramContainer
Stored histogram container.
- static hist_from_tablerow(row: Row)[source]#
Build a
hist.Histfrom an Astropy table row produced by theHistogramAggregator.This is a thin wrapper that constructs a
ChunkHistogramContainerfrom the providedrow(readingn_events,histogramandrow.meta) and delegates the actual reconstruction tohist_from_container().- Parameters:
- rowastropy.table.Row
Table row created by
HistogramAggregator.__call__. Expected to contain ahistogramndarray with shape(n_bins, *data_dims), number of valid events inn_events, and metadata inrow.metadescribing the original axis.
- Returns:
- hist.Hist
Reconstructed histogram object with axes and counts populated.