From 0a05f78c41474f6013323b7500bdb9b62794568b Mon Sep 17 00:00:00 2001 From: towsey Date: Thu, 17 Sep 2020 11:21:43 +1000 Subject: [PATCH] Update NinoxStrenua.cs Issue #370 Add more information with regard to events before and after post-processing --- .../Recognizers/Birds/NinoxStrenua.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/AnalysisPrograms/Recognizers/Birds/NinoxStrenua.cs b/src/AnalysisPrograms/Recognizers/Birds/NinoxStrenua.cs index 61f396ef9..452d3a06a 100644 --- a/src/AnalysisPrograms/Recognizers/Birds/NinoxStrenua.cs +++ b/src/AnalysisPrograms/Recognizers/Birds/NinoxStrenua.cs @@ -12,6 +12,7 @@ namespace AnalysisPrograms.Recognizers using Acoustics.Shared.ConfigFile; using AnalysisBase; using AnalysisPrograms.Recognizers.Base; + using AudioAnalysisTools.Events; using AudioAnalysisTools.Indices; using AudioAnalysisTools.WavTools; using log4net; @@ -96,12 +97,21 @@ public override RecognizerResults Recognize( // Generic post processing step 4: Remove events that have excessive noise in their side-bands. // Additional post-processing steps are put here. - // NOTE: THE POST-PROCESSING STEPS BETWEEN HERE AND OF METHOD ARE THE ONLY STEPS THAT MAKE THIS A DIFFERENT RECOGNIZER FROM THE GENERIC. - // TYPICALLY YOU WOULD PROCESS THE INDIVIDUAL TRACKS IN EACH METHOD LOOKING FOR A SPECIFIC SHAPE. + // NOTE: THE POST-PROCESSING STEPS BETWEEN HERE AND OF THE END OF METHOD ARE THE ONLY STEPS THAT MAKE THIS A DIFFERENT RECOGNIZER FROM THE GENERIC. + // TYPICALLY YOU WOULD PROCESS THE INDIVIDUAL TRACKS IN EACH METHOD LOOKING FOR A SPECIFIC TRACK SHAPE. - if (combinedResults.NewEvents.Count == 0) + // POST PROCESSING METHODS HERE >>>>>>>>>>>>>>>>>>>>>>>>>> + + PowerfulOwlLog.Info($"Final event count = {combinedResults.NewEvents.Count}."); + if (combinedResults.NewEvents.Count > 0) { - PowerfulOwlLog.Debug($"Zero events after post-processing."); + int counter = 0; + foreach (var ev in combinedResults.NewEvents) + { + counter++; + var spEvent = (SpectralEvent)ev; + PowerfulOwlLog.Info($" Event[{counter}]: Start={spEvent.EventStartSeconds:f1}; Duration={spEvent.EventDurationSeconds:f2}; Bandwidth={spEvent.BandWidthHertz} Hz"); + } } //UNCOMMENT following line if you want special debug spectrogram, i.e. with special plots.