Function interpolate_time

Source
pub fn interpolate_time<T: AsRef<[f32]>>(
    volts: &T,
    times: &T,
    threshold: f32,
    idx: usize,
    size: usize,
) -> Result<f32, WaveformError>
Expand description

Linear interpolation of the time within a single bin of a TOF waveform

ยงArguments:

  • voltages : Waveform in mV
  • nanoseconds : Calibrated time for the waveform bins in ns
  • threshold : Threshold in mV which is supposed to be crossed within the bin
  • idx : Together with size define a range for the search for the bin which should have the implementation applied to [voltages[idx], voltages[idx + size]]
  • size : Together with idx define a range for the search for the bin which should have the implementation applied to [voltages[idx], voltages[idx + size]]