Skip to content

Commit

Permalink
Update BotaurusPoiciloptilus.cs
Browse files Browse the repository at this point in the history
Add in filter to remove events that are likely to be false positives.
  • Loading branch information
towsey committed May 5, 2020
1 parent d929e75 commit 09ee175
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/AnalysisPrograms/Recognizers/Birds/BotaurusPoiciloptilus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,19 @@ public override RecognizerResults Recognize(
newEvents = CompositeEvent.CombineSimilarProximalEvents(spectralEvents, TimeSpan.FromSeconds(startDiff), (int)hertzDiff);
}

combinedResults.NewEvents = newEvents;
//filter the events for duration and bandwidth
var filteredEvents = new List<EventCommon>();
foreach (var ev in newEvents)
{
var eventDuration = ((SpectralEvent)ev).EventEndSeconds - ev.EventStartSeconds;
var eventBandWidth = ((SpectralEvent)ev).BandWidthHertz;
if (eventDuration > 2.0 && eventDuration < 11.0 && eventBandWidth > 50)
{
filteredEvents.Add(ev);
}
}

combinedResults.NewEvents = filteredEvents;

//UNCOMMENT following line if you want special debug spectrogram, i.e. with special plots.
// NOTE: Standard spectrograms are produced by setting SaveSonogramImages: "True" or "WhenEventsDetected" in <Towsey.PteropusSpecies.yml> config file.
Expand Down

0 comments on commit 09ee175

Please sign in to comment.