Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
JOSSOUD Olivier
CFA Tools
Commits
5b3fc747
Commit
5b3fc747
authored
Apr 06, 2022
by
JOSSOUD Olivier
Browse files
Encoder. Lower the threshold to detect move-up events.
parent
c9103f50
Pipeline
#170341
failed with stage
in 1 minute and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
cfatools/processor/encoder.py
cfatools/processor/encoder.py
+2
-2
No files found.
cfatools/processor/encoder.py
View file @
5b3fc747
...
...
@@ -56,10 +56,10 @@ def get_moveup_events(encoder_df: pd.DataFrame,
``end_position`` (in mm) and ``event_type``.
"""
encoder_df
=
encoder_df
.
copy
()
encoder_df
[
"pos_diff"
]
=
encoder_df
[
"position"
].
diff
()
encoder_df
[
"pos_diff"
]
=
-
encoder_df
[
"position"
].
diff
(
-
1
)
# Get the datetime of the start of each "encoder moves up" event
starts_df
=
encoder_df
[
encoder_df
[
"pos_diff"
]
>
5
]
starts_df
=
encoder_df
[
encoder_df
[
"pos_diff"
]
>
2
]
starts_df
=
starts_df
.
copy
()
starts_df
[
"diff"
]
=
starts_df
.
index
.
to_series
().
diff
().
fillna
(
pd
.
Timedelta
(
days
=
100
))
start_datetimes
=
starts_df
[
starts_df
[
"diff"
]
>
pd
.
Timedelta
(
seconds
=
5
)].
index
.
to_series
()
...
...
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