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
6855f509
Commit
6855f509
authored
Nov 08, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ellipses Seem Mostly Successful
parent
78e1c6fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
19 deletions
+34
-19
df-aggregator.py
df-aggregator.py
+33
-18
cesium.tpl
views/cesium.tpl
+1
-1
No files found.
df-aggregator.py
View file @
6855f509
...
@@ -184,13 +184,15 @@ def process_data(database_name, outfile):
...
@@ -184,13 +184,15 @@ def process_data(database_name, outfile):
likely_location
.
append
(
clustermean
.
tolist
())
likely_location
.
append
(
clustermean
.
tolist
())
cov
=
np
.
cov
(
cluster
[:,
0
],
cluster
[:,
1
])
cov
=
np
.
cov
(
cluster
[:,
0
],
cluster
[:,
1
])
pearson
=
cov
[
0
,
1
]
/
np
.
sqrt
(
cov
[
0
,
0
]
*
cov
[
1
,
1
])
pearson
=
cov
[
0
,
1
]
/
np
.
sqrt
(
cov
[
0
,
0
]
*
cov
[
1
,
1
])
ell_radius_x
=
np
.
sqrt
(
1
+
pearson
)
ell_radius_x
=
np
.
sqrt
(
1
+
pearson
)
*
np
.
sqrt
(
cov
[
0
,
0
])
*
n_std
ell_radius_y
=
np
.
sqrt
(
1
-
pearson
)
ell_radius_y
=
np
.
sqrt
(
1
-
pearson
)
*
np
.
sqrt
(
cov
[
1
,
1
])
*
n_std
scale_x
=
np
.
sqrt
(
cov
[
0
,
0
])
*
n_std
axis_x
=
v
.
inverse
(
clustermean
.
tolist
(),
(
ell_radius_x
+
clustermean
[
0
],
clustermean
[
1
]))[
0
]
scale_y
=
np
.
sqrt
(
cov
[
1
,
1
])
*
n_std
axis_y
=
v
.
inverse
(
clustermean
.
tolist
(),
(
clustermean
[
0
],
ell_radius_y
+
clustermean
[
1
]))[
0
]
u
=
[[
ell_radius_x
*
scale_x
,
ell_radius_y
*
scale_y
],
clustermean
.
tolist
()]
u
=
[[
ell_radius_x
,
ell_radius_y
],
clustermean
.
tolist
()]
w
=
np
.
sum
(
u
,
axis
=
0
)
w
=
np
.
sum
(
u
,
axis
=
0
)
ellipsedata
.
append
([
*
v
.
inverse
(
clustermean
.
tolist
(),
w
),
*
clustermean
.
tolist
()])
ellipsedata
.
append
([
axis_x
,
axis_y
,
v
.
inverse
(
clustermean
.
tolist
(),
w
)[
1
],
*
clustermean
.
tolist
()])
print
(
ellipsedata
)
for
x
in
likely_location
:
for
x
in
likely_location
:
...
@@ -251,19 +253,23 @@ def write_czml(best_point, all_the_points, weighted_point, ellipsedata):
...
@@ -251,19 +253,23 @@ def write_czml(best_point, all_the_points, weighted_point, ellipsedata):
{
{
"uri"
:
"/static/dish.png"
"uri"
:
"/static/dish.png"
},
},
# "rotation": "Cesium.Math.PI_OVER_FOUR",
"verticalOrigin"
:
"BOTTOM"
,
"verticalOrigin"
:
"BOTTOM"
,
"scale"
:
0.75
"scale"
:
0.75
,
"heightReference"
:
"RELATIVE_TO_GROUND"
,
"height"
:
48
,
"width"
:
48
}
}
ellipse_properties
=
{
ellipse_properties
=
{
# "semiMajorAxis": ,
# "semiMinorAxis": ,
# "rotation": ,
"heightReference"
:
"RELATIVE_TO_GROUND"
,
"heightReference"
:
"RELATIVE_TO_GROUND"
,
"outline"
:
"true"
,
"granularity"
:
0.008722222
,
"outlineColor"
:
{
"rgba"
:
[
255
,
0
,
0
,
255
]},
"material"
:
{
"color"
:
{
"solidColor"
:
{
"rgba"
:
[
255
,
0
,
0
,
128
],
"color"
:
{
"rgba"
:
[
255
,
0
,
0
,
90
]
}
}
}
}
}
}
...
@@ -294,15 +300,24 @@ def write_czml(best_point, all_the_points, weighted_point, ellipsedata):
...
@@ -294,15 +300,24 @@ def write_czml(best_point, all_the_points, weighted_point, ellipsedata):
if
ellipsedata
!=
None
:
if
ellipsedata
!=
None
:
for
x
in
ellipsedata
:
for
x
in
ellipsedata
:
rotation
=
360
-
x
[
1
]
if
x
[
0
]
>=
x
[
1
]:
semiMajorAxis
=
x
[
0
]
semiMinorAxis
=
x
[
1
]
rotation
=
360
-
x
[
2
]
else
:
semiMajorAxis
=
x
[
1
]
semiMinorAxis
=
x
[
0
]
rotation
=
360
-
x
[
2
]
rotation
+=
90
if
rotation
<
0
:
if
rotation
<
0
:
rotation
+=
360
rotation
+=
360
elif
rotation
>
359
:
elif
rotation
>
359
:
rotation
-=
360
rotation
-=
360
ellipse_info
=
{
"semiMajorAxis"
:
x
[
0
],
"semiMinorAxis"
:
x
[
0
]
/
2
,
"rotation"
:
math
.
radians
(
rotation
+
45
)}
ellipse_packets
.
append
(
Packet
(
id
=
str
(
x
[
2
])
+
", "
+
str
(
x
[
3
]),
ellipse_info
=
{
"semiMajorAxis"
:
semiMajorAxis
,
"semiMinorAxis"
:
semiMinorAxis
,
"rotation"
:
math
.
radians
(
rotation
-
45
)}
ellipse_packets
.
append
(
Packet
(
id
=
str
(
x
[
3
])
+
", "
+
str
(
x
[
4
]),
ellipse
=
{
**
ellipse_properties
,
**
ellipse_info
},
ellipse
=
{
**
ellipse_properties
,
**
ellipse_info
},
position
=
{
"cartographicDegrees"
:
[
x
[
3
],
x
[
2
],
15
]}))
position
=
{
"cartographicDegrees"
:
[
x
[
4
],
x
[
3
],
15
]}))
for
x
in
receivers
:
for
x
in
receivers
:
receiver_point_packets
.
append
(
Packet
(
id
=
x
.
station_id
,
receiver_point_packets
.
append
(
Packet
(
id
=
x
.
station_id
,
...
...
views/cesium.tpl
View file @
6855f509
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
viewer
.
zoomTo
(
dataSourcePromise
);
viewer
.
zoomTo
(
dataSourcePromise
);
// Add Cesium OSM Buildings, a global 3D buildings layer.
// Add Cesium OSM Buildings, a global 3D buildings layer.
const
buildingTileset
=
viewer
.
scene
.
primitives
.
add
(
Cesium
.
createOsmBuildings
());
//
const buildingTileset = viewer.scene.primitives.add(Cesium.createOsmBuildings());
</script>
</script>
</div>
</div>
...
...
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