Skip to content

Commit 155cad3

Browse files
committed
final options
1 parent f1b5d7a commit 155cad3

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/ramanchada2/misc/utils/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919

2020
from .matchsets import (
2121
match_peaks_optimized, match_peaks_monotonic,
22-
match_peaks_cluster, match_peaks_cluster_robust
22+
match_peaks_monotonic_simple,
23+
match_peaks_cluster
2324
)

src/ramanchada2/protocols/calibration/xcalibration.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
from 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
)
1516
from ramanchada2.spectrum import Spectrum
1617
from .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

Comments
 (0)