StatisticsAggregator#
- class ctapipe.monitoring.StatisticsAggregator(**kwargs: Any)[source]#
Bases:
TelescopeComponent
Base component to handle the computation of aggregated statistic values from a table containing e.g. charges, peak times and/or charge variances (images).
Attributes Summary
Size of the chunk used for the computation of aggregated statistic values
Methods Summary
__call__
(table[, masked_pixels_of_sample, ...])Divide table into chunks and compute aggregated statistic values.
compute_stats
(images, masked_pixels_of_sample)Attributes Documentation
- chunk_size#
Size of the chunk used for the computation of aggregated statistic values
Methods Documentation
- __call__(table, masked_pixels_of_sample=None, chunk_shift=None, col_name='image') Table [source]#
Divide table into chunks and compute aggregated statistic values.
This function divides the input table into overlapping or non-overlapping chunks of size
chunk_size
and call the relevant function of the particular aggregator to compute aggregated statistic values. The chunks are generated in a way that ensures they do not overflow the bounds of the table. - Ifchunk_shift
is None, chunks will not overlap, but the last chunk is ensured to be of sizechunk_size
, even if it means the last two chunks will overlap. - Ifchunk_shift
is provided, it will determine the number of samples to shift between the start of consecutive chunks resulting in an overlap of chunks. Chunks that overflows the bounds of the table are not considered.- Parameters:
- tableastropy.table.Table
table with images of shape (n_images, n_channels, n_pixels), event IDs and timestamps of shape (n_images, )
- masked_pixels_of_samplendarray, optional
boolean array of masked pixels of shape (n_channels, n_pixels) that are not available for processing
- chunk_shiftint, optional
number of samples to shift between the start of consecutive chunks
- col_namestring
column name in the table
- Returns:
- astropy.table.Table
table containing the start and end values as timestamps and event IDs as well as the aggregated statistic values (mean, median, std) for each chunk
- abstract compute_stats(images, masked_pixels_of_sample) StatisticsContainer [source]#