NegativePeaks

class cubie.outputhandling.summarymetrics.negative_peaks.NegativePeaks(precision)[source]

Bases: SummaryMetric

Summary metric that records the indices of detected negative peaks.

Notes

The buffer stores the two previous values, a peak counter, and slots for the recorded negative peak indices. The algorithm assumes 0.0 does not occur in valid data so it can serve as an initial sentinel.

__init__(precision) None[source]

Initialise the NegativePeaks summary metric.

build() MetricFuncCache[source]

Generate CUDA device functions for negative peak detection.

Returns:

Cache containing the device update and save callbacks.

Return type:

MetricFuncCache

Notes

The update callback compares the current value against stored history to identify negative peaks (local minima), while the save callback copies stored indices and resets the buffer for the next period.