Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
df-aggregator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
df-aggregator
Commits
981a4123
Commit
981a4123
authored
Mar 23, 2021
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Supports multi-user map interaction
parent
c9abfe67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
33 deletions
+64
-33
CHANGELOG.md
CHANGELOG.md
+10
-4
README.md
README.md
+2
-7
df-aggregator.py
df-aggregator.py
+22
-14
cesium.tpl
views/cesium.tpl
+30
-8
No files found.
CHANGELOG.md
View file @
981a4123
## Recent Changes:
-
The LOB for each receiver on the map is now red for low confidence LOBs and green
for high confidence LOBs.
-
Receivers on map update every 2.5 Seocnds.
-
To customize this change
`refreshrate`
at the top of
`static/receiver_configurator.js`
.
-
Changed the way ellipse and clustering parameters are handled. This allows for
multi-user map interaction.
-
Updated to Cesium 1.79
## Previous Changes
-
The LOB for each receiver on the map changes color based on the power and
confidence thresholds.
-
Green when both power and confidence are above their thresholds
-
Orange when just power is above it's threshold.
-
Red when power is below it's minimum threshold.
-
Receivers on map update every 2.5 Seocnds.
-
To customize this change
`refreshrate`
at the top of
`static/receiver_configurator.js`
.
-
Your old database files will not work directly with this latest commit. Several changes have been made
to the database structure to accomodate new features.
-
Now introducing Single Receiver Mode! This will give you functionality similar to, but better than
...
...
README.md
View file @
981a4123
# DF Aggregator
## Recent Changes:
-
The LOB for each receiver on the map changes color based on the power and
confidence thresholds.
-
Green when both power and confidence are above their thresholds
-
Orange when just power is above it's threshold.
-
Red when power is below it's minimum threshold.
-
Receivers on map update every 2.5 Seocnds.
-
To customize this change
`refreshrate`
at the top of
`static/receiver_configurator.js`
.
-
Changed the way ellipse and clustering parameters are handled. This allows for
multi-user map interaction.
-
For previous changes see the
[
Change Log
](
CHANGELOG.md
)
.
## Installing:
...
...
df-aggregator.py
View file @
981a4123
...
...
@@ -214,9 +214,9 @@ def plot_intersects(lat_a, lon_a, doa_a, lat_b, lon_b, doa_b, max_distance = 100
# We start this in it's own process do it doesn't eat all of your RAM.
# This becomes noticable at over 10k intersections.
#######################################################################
def
do_dbscan
(
X
):
def
do_dbscan
(
X
,
epsilon
,
minsamp
):
DBSCAN_WAIT_Q
.
put
(
True
)
db
=
DBSCAN
(
eps
=
ms
.
eps
,
min_samples
=
ms
.
min_
samp
)
.
fit
(
X
)
db
=
DBSCAN
(
eps
=
epsilon
,
min_samples
=
min
samp
)
.
fit
(
X
)
DBSCAN_Q
.
put
(
db
.
labels_
)
if
not
DBSCAN_WAIT_Q
.
empty
():
DBSCAN_WAIT_Q
.
get
()
...
...
@@ -225,7 +225,7 @@ def do_dbscan(X):
# Computes DBSCAN Alorithm is applicable,
# finds the mean of a cluster of intersections.
###############################################
def
process_data
(
database_name
):
def
process_data
(
database_name
,
epsilon
,
min_samp
):
n_std
=
3.0
intersect_list
=
[]
likely_location
=
[]
...
...
@@ -245,7 +245,7 @@ def process_data(database_name):
WHERE aoi_id=? ORDER BY confidence LIMIT 25000'''
,
[
aoi
])
intersect_array
=
np
.
array
(
curs
.
fetchall
())
if
intersect_array
.
size
!=
0
:
if
ms
.
eps
>
0
:
if
epsilon
>
0
:
X
=
StandardScaler
()
.
fit_transform
(
intersect_array
[:,
0
:
2
])
n_points
=
len
(
X
)
size_x
=
sys
.
getsizeof
(
X
)
/
1024
...
...
@@ -255,7 +255,7 @@ def process_data(database_name):
print
(
"Waiting for my turn..."
)
time
.
sleep
(
1
)
starttime
=
time
.
time
()
db
=
Process
(
target
=
do_dbscan
,
args
=
(
X
,))
db
=
Process
(
target
=
do_dbscan
,
args
=
(
X
,
epsilon
,
min_samp
))
db
.
daemon
=
True
db
.
start
()
try
:
...
...
@@ -443,7 +443,7 @@ def write_geojson(best_point, all_the_points):
###############################################
# Writes output.czml used by the WebUI
###############################################
def
write_czml
(
best_point
,
all_the_points
,
ellipsedata
):
def
write_czml
(
best_point
,
all_the_points
,
ellipsedata
,
plotallintersects
,
eps
):
point_properties
=
{
"pixelSize"
:
5.0
,
"heightReference"
:
"CLAMP_TO_GROUND"
,
...
...
@@ -475,7 +475,7 @@ def write_czml(best_point, all_the_points, ellipsedata):
best_point_packets
=
[]
ellipse_packets
=
[]
if
len
(
all_the_points
)
>
0
and
(
ms
.
plotintersects
or
ms
.
eps
==
0
):
if
len
(
all_the_points
)
>
0
and
(
plotallintersects
or
eps
==
0
):
all_the_points
=
np
.
array
(
all_the_points
)
scaled_time
=
minmax_scale
(
all_the_points
[:,
-
1
])
all_the_points
=
np
.
column_stack
((
all_the_points
,
scaled_time
))
...
...
@@ -695,20 +695,20 @@ def cesium():
###############################################
@get
(
'/update'
)
def
update_cesium
():
ms
.
eps
=
float
(
request
.
query
.
eps
)
if
request
.
query
.
eps
else
ms
.
eps
# eps = float(request.query.eps) if request.query.eps else ms.eps
# min_samp = float(request.query.minpts) if request.query.minpts else ms.min_samp
ms
.
min_conf
=
float
(
request
.
query
.
minconf
)
if
request
.
query
.
minconf
else
ms
.
min_conf
ms
.
min_power
=
float
(
request
.
query
.
minpower
)
if
request
.
query
.
minpower
else
ms
.
min_power
ms
.
min_samp
=
float
(
request
.
query
.
minpts
)
if
request
.
query
.
minpts
else
ms
.
min_samp
if
request
.
query
.
rx
==
"true"
:
ms
.
receiving
=
True
elif
request
.
query
.
rx
==
"false"
:
ms
.
receiving
=
False
if
request
.
query
.
plotpts
==
"true"
:
ms
.
plotintersects
=
True
elif
request
.
query
.
plotpts
==
"false"
:
ms
.
plotintersects
=
False
#
if request.query.plotpts == "true":
#
ms.plotintersects = True
#
elif request.query.plotpts == "false":
#
ms.plotintersects = False
return
"OK"
...
...
@@ -736,8 +736,16 @@ def rx_params():
###############################################
@get
(
'/output.czml'
)
def
tx_czml_out
():
eps
=
float
(
request
.
query
.
eps
)
if
request
.
query
.
eps
else
ms
.
eps
min_samp
=
float
(
request
.
query
.
minpts
)
if
request
.
query
.
minpts
else
ms
.
min_samp
if
request
.
query
.
plotpts
==
"true"
:
plotallintersects
=
True
elif
request
.
query
.
plotpts
==
"false"
:
plotallintersects
=
False
else
:
plotallintersects
=
ms
.
plotintersects
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate, max-age=0'
)
output
=
write_czml
(
*
process_data
(
database_name
)
)
output
=
write_czml
(
*
process_data
(
database_name
,
eps
,
min_samp
),
plotallintersects
,
eps
)
return
str
(
output
)
###############################################
...
...
views/cesium.tpl
View file @
981a4123
...
...
@@ -238,10 +238,31 @@
}
function
loadTxCzml
()
{
let
parameter
=
""
;
let
spinner
=
document
.
getElementById
(
"loader"
);
spinner
.
style
.
visibility
=
"visible"
;
spinner
.
style
.
zIndex
=
"10"
;
let
promise1
=
transmittersDataSource
.
load
(
'/output.czml'
);
const
epsslider
=
document
.
getElementById
(
"epsilonRange"
);
const
minpointslider
=
document
.
getElementById
(
"minpointRange"
);
const
intersect_en
=
document
.
getElementById
(
"intersect_en"
);
if
(
minpointslider
!==
null
)
{
parameter
+=
"minpts="
+
minpointslider
.
value
+
"&"
;
}
if
(
epsslider
!==
null
)
{
parameter
+=
"eps="
+
epsslider
.
value
+
"&"
;
}
if
(
intersect_en
!==
null
)
{
if
(
intersect_en
.
checked
)
{
parameter
+=
"plotpts=true"
+
"&"
;
}
else
{
parameter
+=
"plotpts=false"
+
"&"
;
}
}
console
.
log
(
parameter
);
let
promise1
=
transmittersDataSource
.
load
(
'/output.czml?'
+
parameter
);
Cesium
.
when
(
promise1
,
function
(
dataSource1
){
spinner
.
style
.
visibility
=
"hidden"
;
spinner
.
style
.
zIndex
=
"0"
;
...
...
@@ -426,7 +447,7 @@
epsoutput
.
innerHTML
=
this
.
value
;
}
epsslider
.
onpointerup
=
function
()
{
updateParams
(
"
eps="
+
this
.
value
);
updateParams
(
"
"
);
}
powerslider
.
oninput
=
function
()
{
poweroutput
.
innerHTML
=
this
.
value
;
...
...
@@ -444,7 +465,7 @@
minpointoutput
.
innerHTML
=
this
.
value
;
}
minpointslider
.
onpointerup
=
function
()
{
updateParams
(
"
minpts="
+
this
.
value
);
updateParams
(
"
"
);
}
rx_enable
.
onchange
=
function
()
{
...
...
@@ -456,11 +477,12 @@
}
intersect_en
.
onchange
=
function
()
{
if
(
intersect_en
.
checked
)
{
updateParams
(
"plotpts=true"
);
}
else
{
updateParams
(
"plotpts=false"
);
}
updateParams
(
""
);
// if (intersect_en.checked) {
// updateParams("plotpts=true");
// } else {
// updateParams("plotpts=false");
// }
}
</script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment