pyhiperta.calibration.select_channel¶
- pyhiperta.calibration.select_channel(waveform_high: ndarray, waveform_low: ndarray, gains: ndarray, pedestals: ndarray, window_integration_correction: ndarray, threshold: float) Tuple[ndarray, ndarray, ndarray, ndarray] [source]¶
Select values to use in waveforms high/low gain and corresponding gains and pedestals based on threshold.
The choice is independent per shower and per pixel, but shared in time for a given pixel: For each pixel, if any value of waveform_high is above threshold then the low gain and corresponding waveform channel and pedestal is chosen. Otherwise the high gain is chosen.
- Parameters:
waveforms_high (np.ndarray) – R0 waveform high gain. Shape: (N_batch, N_frames, N_pixels)
waveform_low (np.ndarray) – R0 waveform low gain. Shape: (N_batch, N_frames, N_pixels)
gains (np.ndarray) – Per-pixel high and low gains. gains[0] is high gain, gains[1] is low gains. shape (2, N_pixels)
pedestals (np.ndarray) – Per-pixel pedestal for low and high gains. pedestals[0] corresponds to high gain, pedestals[1] corresponds to low gain. Shape (2, N_pixels)
window_integration_correction (np.ndarray) – Array of shape (2,) containing the correction to apply after a windowed integration, for each gain.
threshold (float) – Threshold to chose the waveform channel. A value above threshold indicates that the high gain waveform saturated and low gain should be used.
- Returns:
The waveform selected from each gains based on threshold, associated gains, pedestals and integration correction to used. The order is: - waveform : np.ndarray
waveform where the appropriate gain has been selected. Shape (N_batch, N_frames, N_pixels)
gains : np.ndarray Gain to use to calibrate waveform (high gain when waveform_high wasn’t above threshold and low gain otherwise). Shape (N_batch, N_pixels)
pedestals : np.ndarray Pedestals to use to calibrate waveform. Shape (N_batch, N_pixels)
window_integration_correction : np.ndarray Correction to use after the integration. Shape(N_batch, N_pixels)
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]