feat: tune multi-source peak sensitivity

This commit is contained in:
Codex
2026-08-28 16:30:01 +09:00
parent a54aa25cd9
commit 7cd737429a
9 changed files with 119 additions and 3 deletions
+26
View File
@@ -86,6 +86,32 @@ test("복수 source와 threshold detection을 one-to-one matching한다", () =>
);
});
test("peak 검출 감도를 낮추면 약한 두 번째 음원을 선택한다", () => {
const scan = { xMin: -2, xMax: 2, yMin: -2, yMax: 2, z: 1, columns: 5, rows: 5 };
const rawMap = new Float32Array(25);
rawMap[6] = 10;
rawMap[18] = 2.5;
const options = {
rawMap,
scan,
sources: [
{ id: "strong", position: [-1, 1, 1] },
{ id: "weak", position: [1, -1, 1] },
],
matchToleranceM: 0.25,
minimumPeakDistanceM: 0,
};
const conservative = evaluateDasBand({ ...options, detectionThresholdRatio: 0.5 });
const recommended = evaluateDasBand({ ...options, detectionThresholdRatio: 0.25 });
assertEqual(conservative.detections.length, 1, "50% threshold omits the weak peak");
assertEqual(conservative.counts.falseNegative, 1, "one source remains undetected");
assertEqual(recommended.detections.length, 2, "25% threshold retains the weak peak");
assertEqual(recommended.counts.truePositive, 2, "both sources match at recommended sensitivity");
assertEqual(recommended.parameters.detectionThresholdRatio, 0.25, "selected ratio is recorded");
});
test("zero map 평가가 빈 peak와 유한한 metric을 반환한다", () => {
const scan = { xMin: -1, xMax: 1, yMin: -1, yMax: 1, z: 1, columns: 2, rows: 2 };
const evaluation = evaluateDasBand({