Renaming circlebot -> advisorycircular.

This commit is contained in:
John Wiseman 2020-05-03 15:26:25 -07:00
parent fcbb023a5e
commit 579a180d51
2 changed files with 47 additions and 41 deletions

View File

@ -1,5 +1,5 @@
{ {
"name": "circlebot", "name": "advisorycircular",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"devDependencies": { "devDependencies": {

View File

@ -1,4 +1,4 @@
(ns lemondronor.circlebot (ns lemondronor.advisorycircular
(:require (:require
["commander" :as commander] ["commander" :as commander]
["fs" :as fs] ["fs" :as fs]
@ -166,7 +166,8 @@
(defn ac-desc [ac] (defn ac-desc [ac]
(str (:icao ac) " " (:lat ac) " " (:lon ac) (str (:icao ac) " " "http://tar1090.adsbexchange.com/?icao=" (:icao ac)
" " (:lat ac) " " (:lon ac)
" #" (:registration ac) " " (:alt ac) " " (:curviness ac) " " " #" (:registration ac) " " (:alt ac) " " (:curviness ac) " "
(:normalized-curviness ac))) (:normalized-curviness ac)))
@ -476,7 +477,12 @@
(:distance airport-properties) (:distance airport-properties)
(:minimum-airport-distance-km config) (:minimum-airport-distance-km config)
(:label airport-properties) (:label airport-properties)
()) ()))
(let [alts (map :alt recent-positions)
min-alt (apply min alts)
max-alt (apply max alts)
ratio (/ max-alt min-alt)]
(log-info "%s: ratio of min alt to max alt: %s [%s - %s]" icao (.toFixed (/ max-alt min-alt) 1) min-alt max-alt))
(do (do
(p/let [coarse (pelias/reverse (:pelias config) lat lon {:layers "coarse"})] (p/let [coarse (pelias/reverse (:pelias config) lat lon {:layers "coarse"})]
(let [coarse (first (:features coarse))] (let [coarse (first (:features coarse))]
@ -512,7 +518,7 @@
js/JSON js/JSON
(clj->js (track->geojson older-positions recent-positions icao centroid))) (clj->js (track->geojson older-positions recent-positions icao centroid)))
{}))) {})))
(log-warn "Skipping tweet %s %s" image-path description))))))))))) (log-warn "Skipping tweet %s %s" image-path description))))))))))
(defn process-potential-circles [acs config now] (defn process-potential-circles [acs config now]
@ -530,7 +536,7 @@
;; This is how many degrees of turning we need to see over ;; This is how many degrees of turning we need to see over
;; max-history-age-ms ms to consider it a potential circling ;; max-history-age-ms ms to consider it a potential circling
;; aircraft. ;; aircraft.
:curviness-threshold-degrees 1440 :curviness-threshold-degrees (* 2 360)
;; If the centroid of the aircraft's positions is less than this ;; If the centroid of the aircraft's positions is less than this
;; close to an airport, then it's probably just doing flight ;; close to an airport, then it's probably just doing flight
;; training. ;; training.