pyhiperta.integration.integrate_local_peak

pyhiperta.integration.integrate_local_peak(waveform: ndarray, nb_frames_before_max: int, nb_frames_after_max: int, time_bin_duration_ns: float = 1.0) Tuple[ndarray, ndarray][source]

Integrate (sum the number of photoelectrons) in the waveform pulses in a window around the pulse maximum.

The method does the following: find the maximum in time for each pixel independently, then sum the frames from max - nb_slice_before_peak to max + nb_slice_after_peak (inclusive on both end). If the window wouldn’t fit entirely in the available frames, because the maximum position is too close to one of the edges, the window is shifted towards the center until it includes the same number of frames.

Parameters:
  • waveform (np.ndarray) – Batch or single video samples of the shower events. Shape: (N_batch, N_frames, N_pixels)

  • nb_frames_before_max (int) – Number of frames before the maximum to include in the integration window.

  • nb_slice_after_peak (int) – Number of frames after the maximum to include in the integration window.

  • time_bin_duration_ns (float) – Amount of time between 2 frames in the waveforms. It is used to compute the maximum signal time.

Returns:

Signal charge (integrated waveform signal) and peak maximum time.

Return type:

Tuple[np.ndarray, np.ndarray]

Examples

>>> waveforms = 10.0 * np.random.random((12, 40, 1855))  # "random shower samples"
>>> images = integrate_local_peak(waveforms, 3, 3)  # shape (12, 1855)1
Raises:

ValueError – If the number of frames to include before or after the maximum is strictly negative.