Implemented weighting properly in K-d matcher

This commit is contained in:
2016-04-13 02:22:14 +01:00
parent f7d3e5f1ab
commit 5a12ee1fbb
2 changed files with 14 additions and 12 deletions
+12 -12
View File
@@ -43,19 +43,19 @@ database = {
# higher presendence when finding the best matches.
matcher_weightings = {
"f0" : 1,
"spccntr" : 0.,
"spcsprd" : 0.,
"spcflux" : 0.,
"spccf" : 0.,
"spcflatness": 0.,
"spccntr" : 1.,
"spcsprd" : 2.,
"spcflux" : 2.,
"spccf" : 2.,
"spcflatness": 3.,
"zerox" : 0.,
"rms" : 0,
"peak": 0.,
"centroid": 0.,
"kurtosis": 0.,
"skewness": 0.,
"variance": 0.,
"harm_ratio": 0.
"rms" : 1,
"peak": 2.,
"centroid": 1.,
"kurtosis": 1.,
"skewness": 1.,
"variance": 2.,
"harm_ratio": 1.
}
# Specifies the method for averaging analysis frames to create a single value
+2
View File
@@ -426,6 +426,7 @@ class Matcher:
analysis_formatting = self.analysis_dict[analysis]
target_data, s = target_entry.analysis_data_grains(target_times, analysis, format=analysis_formatting)
target_data = target_data ** weightings[analysis]
all_target_analyses[i] = target_data
@@ -449,6 +450,7 @@ class Matcher:
analysis_formatting = self.analysis_dict[analysis]
source_data, s = source_entry.analysis_data_grains(source_times, analysis, format=analysis_formatting)
source_data = source_data ** weightings[analysis]
all_source_analyses[i] = source_data