mscore::timstof::quadrupole

Function smooth_step_up_down

Source
pub fn smooth_step_up_down(
    x: &Vec<f64>,
    up_start: f64,
    up_end: f64,
    down_start: f64,
    down_end: f64,
    k: f64,
) -> Vec<f64>
Expand description

Sigmoide step function for quadrupole selection simulation

Arguments:

  • x - mz values
  • up_start - start of the step up
  • up_end - end of the step up
  • down_start - start of the step down
  • down_end - end of the step down
  • k - steepness of the step

Returns:

  • Vec<f64> - transmission probability for each mz value

ยงExamples

use mscore::timstof::quadrupole::smooth_step_up_down;

let mz = vec![100.0, 200.0, 300.0];
let transmission = smooth_step_up_down(&mz, 150.0, 200.0, 250.0, 300.0, 0.5).iter().map(
|&x| (x * 100.0).round() / 100.0).collect::<Vec<f64>>();
assert_eq!(transmission, vec![0.0, 1.0, 0.0]);