pyhiperta.cleaning.tail_cuts_cleaning

pyhiperta.cleaning.tail_cuts_cleaning(waveforms_2D: ndarray, pixel_threshold: float, neighbors_threshold: float, min_number_neighbors: int) ndarray[source]

Compute the mask of “signal” pixel that pass the tail_cuts thresholds.

The implementation is in 2 steps: - find the group of pixels that pass the pixel_threshold - find the pixels that pass neighbors_threshold and have at least 1 neighbor passing the 1st step.

Parameters:
  • waveforms_2D (np.ndarray) – Batch or integrated waveform in 2D format. Shape: ([N_batch,] N_pixels_x, N_pixels_y)

  • pixel_threshold (float) – A pixel with a value greater or equal than pixel_threshold and at least min_number_neighbors neighbors that have a value greater or equal than pixel_threshold are considered “signal”.

  • neighbors_threshold (float) – A pixel with a value greater or equal than neighbors_threshold and at least 1 neighbor that is considered signal according to pixel_threshold will be considered “signal” as well.

  • min_number_neighbors (int) – Minimum number of neighboring pixels that must have a value above pixel_threshold to be considered “signal”.

Returns:

A boolean mask with value True for “signal” pixels and value False otherwise.

Return type:

np.ndarray

Raises:

ValueError – If the shape of waveforms_2D can not be interpreted as a (batch of) 2D waveforms