nectarchain.dqm.dqm_summary_processor.DQMSummary#

class DQMSummary(r0=False)[source]#

Bases: object

Base class for DQM summary processors.

Provides the interface for per-run initialisation, per-event processing, result aggregation, plotting, and FITS serialisation of DQM outputs.

Initialise the summary processor.

Parameters:
r0bool, optional

Whether to use R0 waveforms (skip R1 corrections).

Methods

configure_for_run

Configure the processor for a new run.

define_for_run

Extract camera geometry from the first event of a run.

finish_run

Finalise per-run accumulations.

get_results

Return aggregated results as a dictionary.

plot_results

Generate and save summary plots.

process_event

Process a single event.

write_all_results

Write all DQM results to a multi-extension FITS file.

configure_for_run()[source]#

Configure the processor for a new run.

Subclasses may override this to perform additional setup.

define_for_run(reader1)[source]#

Extract camera geometry from the first event of a run.

Parameters:
reader1ctapipe_io_nectarcam.LightNectarCAMEventSource

Event source whose first event is used to retrieve the number of pixels and samples.

Returns:
tuple of (int, int)

Number of pixels and number of samples.

finish_run(M, M_ped, counter_evt, counter_ped)[source]#

Finalise per-run accumulations.

Parameters:
Mnp.ndarray

Accumulated physics-event data.

M_pednp.ndarray

Accumulated pedestal-event data.

counter_evtint

Number of physics events processed.

counter_pedint

Number of pedestal events processed.

get_results()[source]#

Return aggregated results as a dictionary.

Returns:
dict

Dictionary of result names to computed arrays or tables.

plot_results(name, fig_path, k, M, M_ped, Mean_M_overPix, Mean_M_ped_overPix)[source]#

Generate and save summary plots.

Parameters:
namestr

Base name for the plot files.

fig_pathstr

Directory where plots should be saved.

kint

Gain channel index.

Mnp.ndarray

Physics-event accumulations.

M_pednp.ndarray

Pedestal-event accumulations.

Mean_M_overPixnp.ndarray

Physics mean over pixels.

Mean_M_ped_overPixnp.ndarray

Pedestal mean over pixels.

process_event(evt, noped)[source]#

Process a single event.

Parameters:
evtNectarCAMDataContainer

The event to process.

nopedbool

Whether pedestal subtraction should be skipped.

write_all_results(path, DICT)[source]#

Write all DQM results to a multi-extension FITS file.

Parameters:
pathstr

Output path prefix (_Results.fits is appended).

DICTdict

Nested dictionary of result-name / content pairs.