Files
SpectralPlot/src-tauri/src/algorithm/mod.rs
2024-08-21 14:19:40 +08:00

28 lines
829 B
Rust

mod smoothmethod;
mod spectraltools;
mod sharpmethod;
#[tauri::command]
pub fn interpolate_spline(x: Vec<f64>, y: Vec<f64>, step: f64) ->Vec<(f64, f64)>{
spectraltools::interpolate_spline(x, y, step).unwrap()
}
#[tauri::command]
pub fn interpolate_spline_at_points(x: Vec<f64>, y: Vec<f64>, x_target: Vec<f64>) -> Vec<f64>{
spectraltools::interpolate_spline_at_points(x, y, x_target).unwrap()
}
#[tauri::command]
pub fn sg_smooth(data: Vec<f64>, window: usize, order: usize) -> Vec<f64> {
smoothmethod::savgol(data, window, order)
}
#[tauri::command]
pub fn gaussian_filter_high(data: Vec<f64>, sigma: f64) -> Vec<f64> {
sharpmethod::high_pass_gaussian_filter(data, sigma)
}
#[tauri::command]
pub fn find_peek(data: Vec<f64>, minheigh: f64) -> Vec<(u32, f64)> {
spectraltools::find_peek(data, minheigh)
}