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 valuesup_start
- start of the step upup_end
- end of the step updown_start
- start of the step downdown_end
- end of the step downk
- 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]);