Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
locklost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jameson Rollins
locklost
Commits
79bfc176
Commit
79bfc176
authored
4 years ago
by
Camilla Compton
Browse files
Options
Downloads
Patches
Plain Diff
fix error: threshold to be returned by refine_channel
parent
9b328d1f
No related branches found
No related tags found
2 merge requests
!98
Draft: WIP Positive/negative standard deviation refinement
,
!97
Split up refine_time into two functions so the calculation can be called separately
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
locklost/plugins/refine.py
+11
-7
11 additions, 7 deletions
locklost/plugins/refine.py
with
11 additions
and
7 deletions
locklost/plugins/refine.py
+
11
−
7
View file @
79bfc176
...
...
@@ -13,8 +13,9 @@ from .. import data
def
refine_time
(
event
):
"""
Refine lock loss event time
Save refined time to event, create tag and graphs
"""
gps
=
event
.
transition_gps
refined_gps
=
None
# find indicator channel to use based on guardian state
...
...
@@ -24,7 +25,8 @@ def refine_time(event):
window
=
config
.
REFINE_WINDOW
refined_gps
=
refine_channel
(
# find threshold and refined time using indicator channel
threshold
,
refined_gps
=
refine_channel
(
event
,
params
,
window
,
...
...
@@ -48,12 +50,11 @@ def refine_time(event):
)
def
refine_channel
(
event
,
params
,
window
):
"""
Refine lockloss event time using channel specified
def
refine_channel
(
event
,
params
,
window
,
refined_gps
=
None
,
threshold
=
None
):
"""
Refine lockloss event time using channel specified
"""
gps
=
event
.
transition_gps
refined_gps
=
None
channels
=
[
params
[
'
CHANNEL
'
],
...
...
@@ -92,13 +93,16 @@ def refine_channel(event, params, window):
ind
=
np
.
min
(
inds
)
refined_gps
=
buf
.
tarray
[
ind
]
logging
.
info
(
"
refined time: {}
"
.
format
(
refined_gps
))
return
refined_gps
else
:
logging
.
info
(
"
no threshold crossings, unable to resolve time
"
)
return
threshold
,
refined_gps
def
plot_indicators
(
event
,
params
,
refined_gps
=
None
,
threshold
=
None
):
"""
Create graphs showing indicators of refined time
"""
t0
=
event
.
transition_gps
trans
=
event
.
transition_index
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment