From 6246a9d3ab4dccbabd84cc9522844f218a97f722 Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Fri, 10 Apr 2020 17:23:55 -0700 Subject: [PATCH] Filter out positions that are too low. Related to issue #25. --- src/main/lemondronor/circlebot.cljs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/lemondronor/circlebot.cljs b/src/main/lemondronor/circlebot.cljs index 84109fb..eb0d565 100644 --- a/src/main/lemondronor/circlebot.cljs +++ b/src/main/lemondronor/circlebot.cljs @@ -187,6 +187,12 @@ (> (:alt ac) 300))) +(defn circling2? [ac config] + (let [relevant-history (filter #(and (:alt %) (> (:alt %) 300)) (:history ac))] + (and (> (geo/flight-curviness relevant-history) (:curviness-threshold-degrees config)) + (> (:alt ac) 300)))) + + ;; Returns a vector of two elements, ;; [updated-database potentially-circling-aircraft] @@ -201,7 +207,7 @@ ac (assoc ac :curviness curviness :normalized-curviness (geo/flight-normalized-curviness (:history ac))) - currently-circling? (circling? ac config) + currently-circling? (circling2? ac config) previously-circling? (:started-circling-time ac)] (cond (and currently-circling?