diff --git a/packages/acoustics-core/realtime-localizer.js b/packages/acoustics-core/realtime-localizer.js index 3661e00..913ca56 100644 --- a/packages/acoustics-core/realtime-localizer.js +++ b/packages/acoustics-core/realtime-localizer.js @@ -248,7 +248,9 @@ export function detectBandPeaks(rawMap, scan, options = {}) { position: [...peak.position], rawValue: peak.value, rawScale, - ...(rawScale === "power" ? { rawPower: peak.value } : {}), + ...(rawScale === "power" + ? { rawPower: peak.value } + : { rawScore: peak.value }), }); if (detections.length === peakDetection.maximumDetections) break; } diff --git a/tests/unit/localization.test.js b/tests/unit/localization.test.js index 660487a..2985b0c 100644 --- a/tests/unit/localization.test.js +++ b/tests/unit/localization.test.js @@ -194,5 +194,6 @@ test("portable and streaming API accept an algorithm choice without Scene synthe { rawScale: "score", minimumPeakDistanceM: 0 }, ); assertEqual(scorePeaks[0].rawScale, "score", "portable peak scale"); + assertEqual(scorePeaks[0].rawScore, scorePeaks[0].rawValue, "portable score alias"); assert(!("rawPower" in scorePeaks[0]), "score is not mislabeled as acoustic power"); });