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
06a27d69
Commit
06a27d69
authored
Dec 09, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some seconds vs milliseconds bugs
parent
d1c90e26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
df-aggregator.py
df-aggregator.py
+11
-5
receiver_configurator.js
static/receiver_configurator.js
+2
-2
No files found.
df-aggregator.py
View file @
06a27d69
...
@@ -21,6 +21,7 @@ from czml3.properties import Position, Polyline, PolylineOutlineMaterial, Color,
...
@@ -21,6 +21,7 @@ from czml3.properties import Position, Polyline, PolylineOutlineMaterial, Color,
from
bottle
import
route
,
run
,
request
,
get
,
post
,
put
,
response
,
redirect
,
template
,
static_file
from
bottle
import
route
,
run
,
request
,
get
,
post
,
put
,
response
,
redirect
,
template
,
static_file
d
=
40000
#draw distance of LOBs in meters
d
=
40000
#draw distance of LOBs in meters
max_age
=
5000
receivers
=
[]
receivers
=
[]
###############################################
###############################################
...
@@ -618,6 +619,7 @@ def run_receiver(receivers):
...
@@ -618,6 +619,7 @@ def run_receiver(receivers):
print
(
"Receiving"
+
dots
*
'.'
)
print
(
"Receiving"
+
dots
*
'.'
)
print
(
"Press Control+C to process data and exit."
)
print
(
"Press Control+C to process data and exit."
)
# Main loop to compute intersections between multiple receivers
intersect_list
=
np
.
array
([])
.
reshape
(
0
,
3
)
intersect_list
=
np
.
array
([])
.
reshape
(
0
,
3
)
for
x
in
range
(
len
(
receivers
)):
for
x
in
range
(
len
(
receivers
)):
for
y
in
range
(
x
):
for
y
in
range
(
x
):
...
@@ -646,14 +648,15 @@ def run_receiver(receivers):
...
@@ -646,14 +648,15 @@ def run_receiver(receivers):
c
.
execute
(
"INSERT INTO intersects VALUES (?,?,?,?)"
,
to_table
)
c
.
execute
(
"INSERT INTO intersects VALUES (?,?,?,?)"
,
to_table
)
# conn.commit()
# conn.commit()
# Loop to compute intersections for a single receiver and update all receivers
for
rx
in
receivers
:
for
rx
in
receivers
:
if
(
rx
.
isSingle
and
rx
.
isMobile
and
rx
.
isActive
and
if
(
rx
.
isSingle
and
rx
.
isMobile
and
rx
.
isActive
and
rx
.
confidence
>=
ms
.
min_conf
and
rx
.
confidence
>=
ms
.
min_conf
and
rx
.
power
>=
ms
.
min_power
and
rx
.
power
>=
ms
.
min_power
and
rx
.
doa_time
>=
rx
.
previous_doa_time
+
5
):
rx
.
doa_time
>=
rx
.
previous_doa_time
+
10000
):
current_doa
=
[
rx
.
doa_time
,
rx
.
station_id
,
rx
.
latitude
,
current_doa
=
[
rx
.
doa_time
,
rx
.
station_id
,
rx
.
latitude
,
rx
.
longitude
,
rx
.
confidence
,
rx
.
doa
]
rx
.
longitude
,
rx
.
confidence
,
rx
.
doa
]
min_time
=
rx
.
doa_time
-
1800000
#half hour
min_time
=
rx
.
doa_time
-
900000
#15 Minutes
c
.
execute
(
'''SELECT latitude, longitude, confidence, lob FROM lobs
c
.
execute
(
'''SELECT latitude, longitude, confidence, lob FROM lobs
WHERE station_id = ? AND time > ?'''
,
[
rx
.
station_id
,
min_time
])
WHERE station_id = ? AND time > ?'''
,
[
rx
.
station_id
,
min_time
])
lob_array
=
c
.
fetchall
()
lob_array
=
c
.
fetchall
()
...
@@ -668,7 +671,12 @@ def run_receiver(receivers):
...
@@ -668,7 +671,12 @@ def run_receiver(receivers):
lon_rxb
=
previous
[
1
]
lon_rxb
=
previous
[
1
]
conf_rxb
=
previous
[
2
]
conf_rxb
=
previous
[
2
]
doa_rxb
=
previous
[
3
]
doa_rxb
=
previous
[
3
]
if
abs
(
doa_rxa
-
doa_rxb
)
>
5
:
# if abs(doa_rxa - doa_rxb) > 5:
spacial_diversity
,
z
=
v
.
inverse
((
lat_rxa
,
lon_rxa
),
(
lat_rxb
,
lon_rxb
))
#print(f"Distance from other points: {spacial_diversity}")
min_diversity
=
500
if
(
spacial_diversity
>
min_diversity
and
abs
(
doa_rxa
-
doa_rxb
)
>
5
):
intersection
=
compute_single_intersections
(
lat_rxa
,
lon_rxa
,
doa_rxa
,
conf_rxa
,
intersection
=
compute_single_intersections
(
lat_rxa
,
lon_rxa
,
doa_rxa
,
conf_rxa
,
lat_rxb
,
lon_rxb
,
doa_rxb
,
conf_rxb
)
lat_rxb
,
lon_rxb
,
doa_rxb
,
conf_rxb
)
if
intersection
:
if
intersection
:
...
@@ -843,8 +851,6 @@ if __name__ == '__main__':
...
@@ -843,8 +851,6 @@ if __name__ == '__main__':
ms
.
receiving
=
options
.
disable
ms
.
receiving
=
options
.
disable
ms
.
plotintersects
=
options
.
plotintersects
ms
.
plotintersects
=
options
.
plotintersects
max_age
=
5
web
=
threading
.
Thread
(
target
=
start_server
,
args
=
(
options
.
ipaddr
,
options
.
port
))
web
=
threading
.
Thread
(
target
=
start_server
,
args
=
(
options
.
ipaddr
,
options
.
port
))
web
.
daemon
=
True
web
.
daemon
=
True
web
.
start
()
web
.
start
()
...
...
static/receiver_configurator.js
View file @
06a27d69
// Update Map ever
5
seconds
// Update Map ever
y n milli
seconds
var
refreshrate
=
1
0000
;
var
refreshrate
=
60
0000
;
var
autoRefresh
=
setInterval
(
function
()
{
updateParams
();
},
refreshrate
);
var
autoRefresh
=
setInterval
(
function
()
{
updateParams
();
},
refreshrate
);
// *************************************************
// *************************************************
...
...
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