Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
1cc97f49
Commit
1cc97f49
authored
3 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
bfx-es
parent
23236f65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!256
Filter funcs
Pipeline
#22807
failed with stage
in 1 minute and 42 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
saqc/core/modules/noise.py
+1
-1
1 addition, 1 deletion
saqc/core/modules/noise.py
saqc/funcs/noise.py
+33
-3
33 additions, 3 deletions
saqc/funcs/noise.py
saqc/lib/tools.py
+0
-2
0 additions, 2 deletions
saqc/lib/tools.py
with
34 additions
and
6 deletions
saqc/core/modules/noise.py
+
1
−
1
View file @
1cc97f49
...
...
@@ -21,4 +21,4 @@ class Noise(ModuleBase):
min_periods
:
PositiveInt
=
None
,
flag
:
float
=
BAD
)
->
SaQC
:
return
self
.
defer
(
"
flagBy
Variance
LowPass
"
,
locals
())
return
self
.
defer
(
"
flagBy
Stat
LowPass
"
,
locals
())
This diff is collapsed.
Click to expand it.
saqc/funcs/noise.py
+
33
−
3
View file @
1cc97f49
...
...
@@ -11,7 +11,7 @@ from saqc.lib.tools import statPass
@register
(
masking
=
'
field
'
,
module
=
"
noise
"
)
def
flagByLowPass
(
data
:
DictOfSeries
,
def
flagBy
Stat
LowPass
(
data
:
DictOfSeries
,
field
:
ColumnName
,
flags
:
Flags
,
stat
:
Callable
[[
np
.
array
,
pd
.
Series
],
float
],
...
...
@@ -22,14 +22,44 @@ def flagByLowPass(data: DictOfSeries,
min_periods
:
PositiveInt
=
None
,
flag
:
float
=
BAD
,
**
kwargs
):
""""""
"""
Flag *chunks* of length, `wnsz`:
1. If they excexceed `thresh` with regard to `stat`:
2. If all (maybe overlapping) *sub-chunks* of *chunk*, with length `sub_wnsz`,
`excexceed `sub_thresh` with regard to `stat`:
Parameters
----------
data : dios.DictOfSeries
A dictionary of pandas.Series, holding all the data.
field : str
The fieldname of the column, holding the data-to-be-flagged.
flags : saqc.Flags
Container to store quality flags to data.
stat: Callable[[np.array, pd.Series], float]
Function to aggregate chunk contnent with.
wnsz: FreqString
Temporal extension of the chunks to test
thresh: PositiveFloat
Threshold, that triggers flagging, if exceeded by stat value.
sub_wnsz: FreqString, default None,
Window size of the sub chunks, that are additionally tested for exceeding
`sub_thresh` with respect to `stat`.
sub_thresh: PositiveFloat, default None
min_periods: PositiveInt, default None
Returns
-------
"""
datcol
=
data
[
field
]
if
not
min_periods
:
min_periods
=
0
wnsz
=
pd
.
Timedelta
(
wnsz
)
sub_wnsz
=
pd
.
Timedelta
(
sub_wnsz
)
if
sub_wnsz
:
sub_wnsz
=
pd
.
Timedelta
(
sub_wnsz
)
to_set
=
statPass
(
datcol
,
stat
,
wnsz
,
thresh
,
sub_wnsz
,
sub_thresh
,
min_periods
,
comparator
=
'
>
'
)
flags
[
to_set
[
to_set
].
index
,
field
]
=
flag
return
data
,
flags
\ No newline at end of file
This diff is collapsed.
Click to expand it.
saqc/lib/tools.py
+
0
−
2
View file @
1cc97f49
...
...
@@ -617,8 +617,6 @@ def statPass(datcol: pd.Series,
exceeding_sub
=
oper
(
min_stat
,
sub_thresh
)
exceeds
=
exceeding_sub
&
exceeds
exceeds
=
exceeding_sub
&
exceeds
to_set
=
pd
.
Series
(
False
,
index
=
exceeds
.
index
)
for
g
in
exceeds
.
groupby
(
by
=
exceeds
.
values
):
...
...
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