1010
1111from ramanchada2 .misc .utils .matchsets import (
1212 match_peaks_optimized , match_peaks_monotonic ,
13- match_peaks_cluster , match_peaks_cluster_robust
13+ match_peaks_monotonic_simple ,
14+ match_peaks_cluster
1415)
1516from ramanchada2 .spectrum import Spectrum
1617from .calibration_component import CalibrationComponent
@@ -220,8 +221,7 @@ def match_peaks(self, threshold_max_distance=9, return_df=False):
220221 }
221222 )
222223 return x_spe , x_reference , x_spe - x_reference , None , df
223-
224- elif self .match_method == "assignment" :
224+ elif self .match_method == "assignment" : # https://en.wikipedia.org/wiki/Hungarian_algorithm
225225 try :
226226 x_spe , x_reference , x_distance , cost_matrix , df = match_peaks_optimized (
227227 spe_pos_dict = self .spe_pos_dict ,
@@ -240,16 +240,16 @@ def match_peaks(self, threshold_max_distance=9, return_df=False):
240240 return x_spe , x_reference , x_distance , None , df
241241 else : # self.match_method == "monotonic":
242242 try :
243- x_spe , x_reference , x_distance , df = match_peaks_cluster_robust (
243+ x_spe , x_reference , x_distance , df = match_peaks_monotonic_simple (
244244 spe_pos_dict = self .spe_pos_dict ,
245245 ref = self .ref ,
246- cost_intensity = 0.25 ,
247- filter_outliers = True ,
248- outlier_threshold = 3.0 , # in standard deviations
246+ tolerance = None ,
247+ relative = False ,
248+ weight_intensity = .5
249249 )
250250 return x_spe , x_reference , x_distance , None , df
251251 except Exception as err :
252- raise err
252+ raise err
253253
254254 def fit_peaks (self , find_kw , fit_peaks_kw , should_fit ):
255255 spe_to_process = self .convert_units (self .spe , self .spe_units , self .ref_units )
0 commit comments