Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
wendelin
Commits
f1ef0990
Commit
f1ef0990
authored
Aug 19, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_drone: create dataframe in a separate function
parent
d50714f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
29 deletions
+27
-29
bt5/erp5_wendelin_drone/PathTemplateItem/portal_callables/DataAnalysisLine_convertDroneDataArrayToScoreArray.py
...les/DataAnalysisLine_convertDroneDataArrayToScoreArray.py
+27
-29
No files found.
bt5/erp5_wendelin_drone/PathTemplateItem/portal_callables/DataAnalysisLine_convertDroneDataArrayToScoreArray.py
View file @
f1ef0990
...
@@ -36,8 +36,11 @@ def rated_value(next_value, previous_value, rate):
...
@@ -36,8 +36,11 @@ def rated_value(next_value, previous_value, rate):
else
:
else
:
return
previous_value
+
(
next_value
-
previous_value
)
*
rate
return
previous_value
+
(
next_value
-
previous_value
)
*
rate
def
nparray_to_dataframe
(
nparray
):
return
pd
.
DataFrame
(
data
=
nparray
.
getArray
(),
columns
=
[
"timestamp (ms)"
,
"latitude ()"
,
"longitude ()"
,
"AMSL (m)"
,
"rel altitude (m)"
,
"yaw ()"
,
"ground speed (m/s)"
,
"climb rate (m/s)"
],
)
...
@@ -51,10 +54,7 @@ sim_flight_names = list(sim_array)
...
@@ -51,10 +54,7 @@ sim_flight_names = list(sim_array)
if
len
(
real_flight_names
)
==
0
:
if
len
(
real_flight_names
)
==
0
:
context
.
log
(
"The real flight data is still missing"
)
context
.
log
(
"The real flight data is still missing"
)
return
return
nparray
=
real_array
.
get
(
real_flight_names
[
0
])
real_flight
=
nparray_to_dataframe
(
real_array
.
get
(
real_flight_names
[
0
]))
nparray_real
=
nparray
.
getArray
()
real_flight
=
pd
.
DataFrame
(
data
=
nparray_real
,
columns
=
[
"timestamp (ms)"
,
"latitude ()"
,
"longitude ()"
,
"AMSL (m)"
,
"rel altitude (m)"
,
"yaw ()"
,
"ground speed (m/s)"
,
"climb rate (m/s)"
])
...
@@ -106,9 +106,7 @@ for name in not_seen_list[:]:
...
@@ -106,9 +106,7 @@ for name in not_seen_list[:]:
if
name
[:
14
]
==
'simulation_log'
:
if
name
[:
14
]
==
'simulation_log'
:
splitted_filename
=
name
[:
-
4
].
split
(
'_'
)
splitted_filename
=
name
[:
-
4
].
split
(
'_'
)
distance_list_tuple
=
([],[],
[],
[],
[])
distance_list_tuple
=
([],[],
[],
[],
[])
nparray
=
sim_array
.
get
(
name
)
simulated_flight
=
nparray_to_dataframe
(
sim_array
.
get
(
name
))
nparray_sim
=
nparray
.
getArray
()
simulated_flight
=
pd
.
DataFrame
(
data
=
nparray_sim
,
columns
=
[
"timestamp (ms)"
,
"latitude ()"
,
"longitude ()"
,
"AMSL (m)"
,
"rel altitude (m)"
,
"yaw ()"
,
"ground speed (m/s)"
,
"climb rate (m/s)"
])
simulated_flight
=
simulated_flight
.
applymap
(
lambda
value
:
np
.
format_float_scientific
(
float
(
value
))
if
isinstance
(
value
,
str
)
and
'e'
in
value
else
value
)
simulated_flight
=
simulated_flight
.
applymap
(
lambda
value
:
np
.
format_float_scientific
(
float
(
value
))
if
isinstance
(
value
,
str
)
and
'e'
in
value
else
value
)
simulated_flight_list
.
append
(
simulated_flight
)
simulated_flight_list
.
append
(
simulated_flight
)
max_simulator_timestamp
=
simulated_flight
[
"timestamp (ms)"
].
max
()
max_simulator_timestamp
=
simulated_flight
[
"timestamp (ms)"
].
max
()
...
...
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