Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
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
c3fa6f67
Commit
c3fa6f67
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
minor bfx
parent
324115b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!49
Dataprocessing features
Pipeline
#4353
passed with stage
Stage: test
in 7 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/proc_functions.py
+10
-10
10 additions, 10 deletions
saqc/funcs/proc_functions.py
with
10 additions
and
10 deletions
saqc/funcs/proc_functions.py
+
10
−
10
View file @
c3fa6f67
...
...
@@ -4,7 +4,7 @@
import
pandas
as
pd
import
numpy
as
np
from
saqc.funcs.register
import
register
from
saqc.lib.ts_operators
import
interpolateNANs
,
validationTrafo
,
aggregate2Freq
from
saqc.lib.ts_operators
import
interpolateNANs
,
aggregate2Freq
,
shift2Freq
from
saqc.lib.tools
import
composeFunction
,
toSequence
...
...
@@ -12,6 +12,7 @@ from saqc.lib.tools import composeFunction, toSequence
def
proc_interpolateMissing
(
data
,
field
,
flagger
,
method
,
inter_order
=
2
,
inter_limit
=
2
,
interpol_flag
=
'
UNFLAGGED
'
,
downgrade_interpolation
=
False
,
return_chunk_bounds
=
False
,
not_interpol_flags
=
None
,
**
kwargs
):
data
=
data
.
copy
()
inter_data
=
interpolateNANs
(
data
[
field
],
method
,
order
=
inter_order
,
inter_limit
=
inter_limit
,
downgrade_interpolation
=
downgrade_interpolation
,
return_chunk_bounds
=
return_chunk_bounds
)
...
...
@@ -47,21 +48,20 @@ def proc_resample(data, field, flagger, freq, func="mean", max_invalid_total_d=n
func
=
composeFunction
(
func
)
flag_agg_func
=
composeFunction
(
flag_agg_func
)
if
func
==
'
shift
'
:
datcol
=
shift2Freq
(
datcol
,
method
,
freq
,
fill_value
=
fill_value
)
if
func
==
"
shift
"
:
datcol
=
shift2Freq
(
datcol
,
method
,
freq
,
fill_value
=
np
.
nan
)
flagscol
=
shift2Freq
(
flagscol
,
method
,
freq
,
fill_value
=
flagger
.
BAD
)
# data resampling
datcol
=
aggregate2Freq
(
datcol
,
method
,
agg_func
=
func
,
freq
=
freq
,
fill_value
=
np
.
nan
,
else
:
datcol
=
aggregate2Freq
(
datcol
,
method
,
freq
,
func
,
fill_value
=
np
.
nan
,
max_invalid_total
=
max_invalid_total_d
,
max_invalid_consec
=
max_invalid_consec_d
)
# flags resampling:
flagscol
=
aggregate2Freq
(
flagscol
,
method
,
agg_func
=
flag_agg_func
,
freq
=
freq
,
fill_value
=
flagger
.
BAD
,
flagscol
=
aggregate2Freq
(
flagscol
,
method
,
freq
,
flag_agg_func
,
fill_value
=
flagger
.
BAD
,
max_invalid_total
=
max_invalid_total_f
,
max_invalid_consec
=
max_invalid_consec_f
)
# data/flags reshaping:
data
[
field
]
=
datcol
reshape_flagger
=
flagger
.
initFlags
(
datcol
).
setFlags
(
field
,
flag
=
flagscol
,
force
=
True
,
**
kwargs
)
flagger
=
flagger
.
getFlagger
(
drop
=
field
).
setFlagger
(
reshape_flagger
)
reshape
d
_flagger
=
flagger
.
initFlags
(
datcol
).
setFlags
(
field
,
flag
=
flagscol
,
force
=
True
,
**
kwargs
)
flagger
=
flagger
.
getFlagger
(
drop
=
field
).
setFlagger
(
reshape
d
_flagger
)
return
data
,
flagger
...
...
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