Filter out positions that are too low.

Related to issue #25.
This commit is contained in:
John Wiseman 2020-04-10 17:23:55 -07:00
parent f1738938b8
commit 6246a9d3ab

View File

@ -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?