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
e738d633
Commit
e738d633
authored
8 years ago
by
Coda Phillips
Browse files
Options
Downloads
Patches
Plain Diff
Add hbb stability check
parent
96d42d97
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
state_checks.py
+47
-0
47 additions, 0 deletions
state_checks.py
with
47 additions
and
0 deletions
state_checks.py
+
47
−
0
View file @
e738d633
...
...
@@ -52,6 +52,27 @@ def hbb_thermistor_check(frame, parameters):
return
frame
def
hbb_stable_check
(
frame
,
parameters
):
interval_seconds
=
frame
[
'
datetime
'
].
diff
().
astype
(
np
.
int64
)
/
1e9
hbbb_diff
=
frame
[
'
HBBbottomTemp
'
].
diff
()
/
interval_seconds
hbba_diff
=
frame
[
'
HBBapexTemp
'
].
diff
()
/
interval_seconds
hbbt_diff
=
frame
[
'
HBBtopTemp
'
].
diff
()
/
interval_seconds
hsr
=
parameters
.
get
(
'
hbb_stable_rate
'
,
.
002
)
hbbb_diff_problem
=
abs
(
hbbb_diff
.
fillna
(
0
))
>
hsr
hbba_diff_problem
=
abs
(
hbba_diff
.
fillna
(
0
))
>
hsr
hbbt_diff_problem
=
abs
(
hbbt_diff
.
fillna
(
0
))
>
hsr
variable_qcs
=
pd
.
DataFrame
({
'
qc_HBBbottomTemp
'
:
hbbb_diff_problem
*
1
,
'
qc_HBBapexTemp
'
:
hbba_diff_problem
*
1
,
'
qc_HBBtopTemp
'
:
hbbt_diff_problem
*
1
},
index
=
frame
.
index
)
frame
=
update_variable_qc
(
frame
,
variable_qcs
)
frame
[
'
hbb_stable_check
'
]
=
(
hbbb_diff_problem
|
hbbt_diff_problem
|
hbbt_diff_problem
)
*
1
annotate_all
(
frame
,
hbbb_diff_problem
,
'
HBB bottom temperature not stable
'
)
annotate_all
(
frame
,
hbba_diff_problem
,
'
HBB apex temperature not stable
'
)
annotate_all
(
frame
,
hbbt_diff_problem
,
'
HBB top temperature not stable
'
)
frame
=
invalidate_records
(
frame
,
'
hbb_stable_check
'
)
return
frame
class
CheckList
(
BaseCheckList
):
...
...
@@ -60,6 +81,32 @@ class CheckList(BaseCheckList):
#### TESTS ####
def
test_hbb_stable_check
():
# Check with rates of .0016
dummy_data
=
pd
.
DataFrame
({
'
HBBbottomTemp
'
:
np
.
arange
(
0
,
2
,.
1
),
'
HBBapexTemp
'
:
np
.
arange
(
0
,
2
,.
1
),
'
HBBtopTemp
'
:
np
.
arange
(
0
,
2
,.
1
),
'
datetime
'
:
pd
.
date_range
(
'
1/1/2000
'
,
periods
=
20
,
freq
=
'
60s
'
),
'
qc_notes
'
:
''
,
'
qc_percent
'
:
0
,
'
sceneMirrorPosition
'
:
ord
(
'
S
'
)
})
frame
=
hbb_stable_check
(
dummy_data
,
{
'
hbb_stable_rate
'
:.
002
}
)
assert
all
(
frame
[
'
hbb_stable_check
'
]
==
0
)
dummy_data
.
ix
[
10
:,
'
HBBbottomTemp
'
]
=
np
.
arange
(
1
,
3
,.
2
)
dummy_data
.
ix
[
10
:,
'
HBBtopTemp
'
]
=
np
.
arange
(
1
,
3
,.
2
)
dummy_data
.
ix
[
10
:,
'
HBBbottomTemp
'
]
=
np
.
arange
(
1
,
3
,.
2
)
frame
=
hbb_stable_check
(
dummy_data
,
{
'
hbb_stable_rate
'
:.
002
}
)
assert
all
(
frame
.
ix
[:
10
,
'
hbb_stable_check
'
]
==
0
)
assert
all
(
frame
.
ix
[
11
:,
'
hbb_stable_check
'
]
==
1
)
def
test_hbb_thermistor_check
():
frame
=
hbb_thermistor_check
(
pd
.
DataFrame
({
'
HBBbottomTemp
'
:[
300
,
333
,
336
],
...
...
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