flightplotting 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flightplotting-0.1.2/flightplotting.egg-info → flightplotting-0.1.3}/PKG-INFO +1 -5
- flightplotting-0.1.3/flightplotting/__init__.py +4 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/plots.py +31 -24
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/traces.py +17 -13
- {flightplotting-0.1.2 → flightplotting-0.1.3/flightplotting.egg-info}/PKG-INFO +1 -5
- flightplotting-0.1.3/flightplotting.egg-info/top_level.txt +1 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/setup.cfg +1 -1
- flightplotting-0.1.2/flightplotting/__init__.py +0 -3
- flightplotting-0.1.2/flightplotting.egg-info/top_level.txt +0 -1
- {flightplotting-0.1.2 → flightplotting-0.1.3}/COPYING +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/MANIFEST.in +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/README.md +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/data/ColdDraftF3APlane.obj +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/data/__init__.py +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/model.py +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/templates.py +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting/titlerenderer.py +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting.egg-info/SOURCES.txt +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting.egg-info/dependency_links.txt +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/flightplotting.egg-info/requires.txt +2 -2
- {flightplotting-0.1.2 → flightplotting-0.1.3}/setup.py +0 -0
- {flightplotting-0.1.2 → flightplotting-0.1.3}/tests/test_traces.py +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flightplotting
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Tools for Plotting Flight Data in Plotly
|
|
5
5
|
Home-page: https://github.com/PyFlightCoach/FlightPlotting
|
|
6
6
|
Author: Thomas David
|
|
7
7
|
Author-email: thomasdavid0@gmail.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Description-Content-Type: text/markdown
|
|
11
9
|
License-File: COPYING
|
|
12
10
|
|
|
@@ -14,5 +12,3 @@ License-File: COPYING
|
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
This module contains utilities for plotting flight data using plotly
|
|
17
|
-
|
|
18
|
-
|
|
@@ -12,28 +12,41 @@ from flightplotting.traces import (
|
|
|
12
12
|
control_inputs,
|
|
13
13
|
cgtrace,
|
|
14
14
|
ribbon,
|
|
15
|
-
vectors
|
|
15
|
+
vectors,
|
|
16
|
+
axestrace
|
|
16
17
|
)
|
|
17
18
|
|
|
18
19
|
from flightanalysis import State, Manoeuvre
|
|
20
|
+
from geometry import Coord
|
|
19
21
|
from flightplotting.model import obj, OBJ
|
|
22
|
+
from flightanalysis import State
|
|
20
23
|
import numpy as np
|
|
24
|
+
from typing import List, Union
|
|
21
25
|
|
|
22
26
|
|
|
23
|
-
def plotsec(
|
|
24
|
-
|
|
27
|
+
def plotsec(secs: Union[State, list[State]], scale=5, nmodels=0, fig=None,
|
|
28
|
+
color: Union[str, list[str]]=None, obj: OBJ=obj, cg=False, width=None,
|
|
29
|
+
height=None, show_axes=False, ribb: bool=False, tips: bool=True, origin=False):
|
|
30
|
+
|
|
25
31
|
traces = []
|
|
26
|
-
if ribb:
|
|
27
|
-
traces += ribbon(sec, scale * 1.85, color)
|
|
28
|
-
|
|
29
|
-
if tips:
|
|
30
|
-
traces += tiptrace(sec, scale * 1.85, text=text)
|
|
31
|
-
|
|
32
|
-
if nmodels > 0:
|
|
33
|
-
traces += meshes(nmodels, sec, color, obj.scale(scale))
|
|
34
32
|
|
|
35
|
-
if
|
|
36
|
-
|
|
33
|
+
if isinstance(secs, State):
|
|
34
|
+
secs = [secs]
|
|
35
|
+
|
|
36
|
+
for i, sec in enumerate(secs):
|
|
37
|
+
text = ["{:.1f}".format(val) for val in sec.data.index]
|
|
38
|
+
_color = color if not color is None else px.colors.qualitative.Plotly[i]
|
|
39
|
+
if ribb:
|
|
40
|
+
traces += ribbon(sec, scale * 1.85, _color)
|
|
41
|
+
if tips:
|
|
42
|
+
traces += tiptrace(sec, scale * 1.85, text=text)
|
|
43
|
+
if nmodels > 0:
|
|
44
|
+
traces += meshes(nmodels, sec, _color, obj.scale(scale))
|
|
45
|
+
if cg:
|
|
46
|
+
traces += cgtrace(sec, text=text, color=_color)
|
|
47
|
+
|
|
48
|
+
if origin:
|
|
49
|
+
traces += axestrace(Coord.zero(), 50)
|
|
37
50
|
|
|
38
51
|
if fig is None:
|
|
39
52
|
|
|
@@ -60,21 +73,15 @@ def plotsec(sec, scale=5, nmodels=0, fig=None, color="orange", obj: OBJ=obj, cg=
|
|
|
60
73
|
|
|
61
74
|
|
|
62
75
|
|
|
63
|
-
def plotdtw(sec: State, manoeuvres, span=3):
|
|
76
|
+
def plotdtw(sec: State, manoeuvres: List[str], span=3):
|
|
64
77
|
fig = go.Figure()
|
|
65
78
|
|
|
66
79
|
traces = []#tiptrace(sec, span)
|
|
67
80
|
|
|
68
|
-
for i,
|
|
69
|
-
name = f"el {i}"
|
|
70
|
-
if hasattr(man, 'name'):
|
|
71
|
-
name=man.name
|
|
72
|
-
elif hasattr(man, "uid"):
|
|
73
|
-
name = man.uid
|
|
74
|
-
|
|
81
|
+
for i, name in enumerate(manoeuvres):
|
|
75
82
|
try:
|
|
76
|
-
seg =
|
|
77
|
-
|
|
83
|
+
seg = sec.get_man_or_el(name)
|
|
84
|
+
|
|
78
85
|
traces += ribbon(seg, span, px.colors.qualitative.Alphabet[i], name)
|
|
79
86
|
|
|
80
87
|
traces.append(go.Scatter3d(
|
|
@@ -90,7 +97,7 @@ def plotdtw(sec: State, manoeuvres, span=3):
|
|
|
90
97
|
print("no data for manoeuvre {}, {}".format(name, ex))
|
|
91
98
|
fig = go.Figure(
|
|
92
99
|
data=traces,
|
|
93
|
-
layout=go.Layout(template="flight3d+judge_view")
|
|
100
|
+
layout=go.Layout(template="flight3d+judge_view"),
|
|
94
101
|
)
|
|
95
102
|
|
|
96
103
|
return fig
|
|
@@ -36,7 +36,10 @@ def meshes(npoints, seq: State, colour, obj: OBJ=obj):
|
|
|
36
36
|
for st in sts:
|
|
37
37
|
ms.append(obj.transform(Transformation(st.pos, st.att)).create_mesh(colour,f"{st.time.t[0]:.1f}"))
|
|
38
38
|
return ms
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
def vector(origin, direction, **kwargs):
|
|
41
|
+
pdata = Point.concatenate([origin, origin+direction])
|
|
42
|
+
return trace3d(*pdata.data.T, **kwargs)
|
|
40
43
|
|
|
41
44
|
|
|
42
45
|
def vectors(npoints: int, seq: State, vectors: Point, **kwargs):
|
|
@@ -44,7 +47,7 @@ def vectors(npoints: int, seq: State, vectors: Point, **kwargs):
|
|
|
44
47
|
step = int(len(seq.data) / (npoints+1))
|
|
45
48
|
for pos, wind in zip(seq.pos[::step], vectors[::step]):
|
|
46
49
|
pdata = Point.concatenate([pos, pos+wind])
|
|
47
|
-
trs.append(trace3d(*pdata.data.T, **kwargs))
|
|
50
|
+
trs.append(trace3d(*pdata.data.T, text=abs(vectors), **kwargs))
|
|
48
51
|
return trs
|
|
49
52
|
|
|
50
53
|
|
|
@@ -182,13 +185,15 @@ def aoa_trace(sec, dash="dash", colours = px.colors.qualitative.Plotly):
|
|
|
182
185
|
def axestrace(cid: Coord, length:float=20.0):
|
|
183
186
|
ntraces = []
|
|
184
187
|
colours = {"x":"red", "y":"blue", "z":"green"}
|
|
185
|
-
for
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
for i, ci in enumerate(cid):
|
|
189
|
+
for ax, col in zip([ci.x_axis, ci.y_axis, ci.z_axis], list("xyz")):
|
|
190
|
+
axis = Point.concatenate([ci.origin, ci.origin + ax * length])
|
|
191
|
+
ntraces.append(go.Scatter3d(
|
|
192
|
+
x=axis.x, y=axis.y, z=axis.z, mode="lines",
|
|
193
|
+
line=dict(color=colours[col]),
|
|
194
|
+
name=col,
|
|
195
|
+
showlegend=True if i==0 else False
|
|
196
|
+
))
|
|
192
197
|
|
|
193
198
|
return ntraces
|
|
194
199
|
|
|
@@ -236,8 +241,8 @@ def ribbon(sec: State, span: float, color: str, name="none"):
|
|
|
236
241
|
|
|
237
242
|
points = Point(_npinterzip(left.data, right.data))
|
|
238
243
|
|
|
239
|
-
|
|
240
|
-
_i =
|
|
244
|
+
|
|
245
|
+
_i = np.array(range(len(points) - 2)) # 1 2 3 4 5
|
|
241
246
|
|
|
242
247
|
_js = np.array(range(1, len(points), 2))
|
|
243
248
|
_j = _npinterzip(_js, _js)[1:-1] # 1 3 3 4 4 5
|
|
@@ -249,7 +254,6 @@ def ribbon(sec: State, span: float, color: str, name="none"):
|
|
|
249
254
|
return [go.Mesh3d(
|
|
250
255
|
x=points.x, y=points.y, z=points.z, i=_i, j=_j, k=_k,
|
|
251
256
|
intensitymode="cell",
|
|
252
|
-
facecolor=np.full(len(
|
|
253
|
-
#hoverinfo=name,
|
|
257
|
+
facecolor=np.full(len(_i), color),
|
|
254
258
|
name=name,
|
|
255
259
|
)]
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flightplotting
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Tools for Plotting Flight Data in Plotly
|
|
5
5
|
Home-page: https://github.com/PyFlightCoach/FlightPlotting
|
|
6
6
|
Author: Thomas David
|
|
7
7
|
Author-email: thomasdavid0@gmail.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Description-Content-Type: text/markdown
|
|
11
9
|
License-File: COPYING
|
|
12
10
|
|
|
@@ -14,5 +12,3 @@ License-File: COPYING
|
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
This module contains utilities for plotting flight data using plotly
|
|
17
|
-
|
|
18
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flightplotting
|
|
@@ -5,7 +5,7 @@ author_email = thomasdavid0@gmail.com
|
|
|
5
5
|
description = Tools for Plotting Flight Data in Plotly
|
|
6
6
|
long_description = file: README.md
|
|
7
7
|
long_description_content_type = text/markdown
|
|
8
|
-
version = 0.1.
|
|
8
|
+
version = 0.1.3
|
|
9
9
|
url = https://github.com/PyFlightCoach/FlightPlotting
|
|
10
10
|
|
|
11
11
|
[options]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|