Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aeri_quality_control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
aeri
aeri_quality_control
Commits
c7434f7b
Commit
c7434f7b
authored
8 years ago
by
Coda Phillips
Browse files
Options
Downloads
Patches
Plain Diff
Document electronics_checks
parent
dd759ba6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
electronic_checks.py
+12
-6
12 additions, 6 deletions
electronic_checks.py
with
12 additions
and
6 deletions
electronic_checks.py
+
12
−
6
View file @
c7434f7b
...
...
@@ -6,18 +6,19 @@ import itertools
electronic_checks
=
BaseCheckList
()
def
find_bb_outliers
(
frame
,
parameters
,
bb
):
"""
Find outliers in blackbody temperatures.
Annotate any problems, and set quality flags for each thermistor
"""
window_length
=
parameters
.
get
(
'
window_length
'
,
50
)
if
bb
==
'
HBB
'
:
delta_thresh
=
.
001
bbb_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}bottomTemp
'
.
format
(
bb
),
delta_thresh
)))
bba_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}apexTemp
'
.
format
(
bb
),
delta_thresh
)))
bbt_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}topTemp
'
.
format
(
bb
),
delta_thresh
)))
else
:
delta_thresh
=
.
01
bbb_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}bottomTemp
'
.
format
(
bb
),
delta_thresh
)))
bba_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}apexTemp
'
.
format
(
bb
),
delta_thresh
)))
bbt_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}topTemp
'
.
format
(
bb
),
delta_thresh
)))
bbb_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}bottomTemp
'
.
format
(
bb
),
delta_thresh
)))
bba_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}apexTemp
'
.
format
(
bb
),
delta_thresh
)))
bbt_outliers
=
np
.
array
(
list
(
_scan_for_outliers
(
frame
,
'
{}topTemp
'
.
format
(
bb
),
delta_thresh
)))
variable_qcs
=
pd
.
DataFrame
({
'
qc_{}bottomTemp
'
.
format
(
bb
)
:
bbb_outliers
*
1
,
...
...
@@ -53,12 +54,17 @@ def _find_6sigma_outliers(frame, window_length, estimation_func=_compute_robust_
return
estimation_func
(
frame
,
window_length
)
>
6
def
_scan_for_outliers
(
frame
,
variable
,
delta_thresh
):
"""
Check for temperature changes exceeding the delta_thresh rate in degK / sec
"""
last
=
None
for
i
,
row
in
frame
.
iterrows
():
# First row cannot be an outlier
if
last
is
None
:
yield
False
last
=
row
else
:
# Compare each row to previous non-outlier row
time_diff
=
(
row
.
datetime
-
last
.
datetime
).
total_seconds
()
variable_diff
=
row
[
variable
]
-
last
[
variable
]
if
abs
(
variable_diff
/
time_diff
)
<
delta_thresh
:
...
...
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