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
d235cf89
Commit
d235cf89
authored
5 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
moisture by prec test pimped
parent
75dfa024
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
funcs/functions.py
+6
-8
6 additions, 8 deletions
funcs/functions.py
with
6 additions
and
8 deletions
funcs/functions.py
+
6
−
8
View file @
d235cf89
...
...
@@ -126,17 +126,15 @@ def flagSoilMoistureBySoilFrost(data, flags, field, flagger, soil_temp_reference
:param frost_level: Value level, the flagger shall check against, when evaluating soil frost level.
"""
# retrieve data series input:
dataseries
=
data
[
field
]
# if reference series is part of input data frame, evaluate input data flags:
# flag_mask = flagger.isFlagged(flags)[soil_temp_reference]
# retrieve reference series
refseries
=
data
[
soil_temp_reference
]
ref_flags
=
flags
[
soil_temp_reference
]
ref_unflagged
=
flagger
.
isFlagged
(
ref_flags
,
flag
=
flagger
.
flags
.
unflagged
())
ref_min_flagged
=
flagger
.
isFlagged
(
ref_flags
,
flag
=
flagger
.
flags
.
min
())
ref_use
=
ref_min_flagged
|
ref_unflagged
# drop flagged values:
# refseries = refseries.loc[~np.array(flag_mask)]
# make refseries index a datetime thingy
refseries
.
index
=
pd
.
to_datetime
(
refseries
.
index
)
refseries
=
refseries
[
ref_use
.
values
]
# drop nan values from reference series, since those are values you dont want to refer to.
refseries
=
refseries
.
dropna
()
...
...
@@ -155,7 +153,7 @@ def flagSoilMoistureBySoilFrost(data, flags, field, flagger, soil_temp_reference
return
ref_series
[
ref_pos
]
<=
check_level
# make temporal frame holding dateindex, since df.apply cant access index
temp_frame
=
pd
.
Series
(
data
series
.
index
)
temp_frame
=
pd
.
Series
(
data
.
index
)
# get flagging mask ("False" denotes "bad"="test succesfull")
mask
=
temp_frame
.
apply
(
check_nearest_for_frost
,
args
=
(
refseries
,
tolerated_deviation
,
frost_level
))
...
...
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