Skip to content
Snippets Groups Projects
Commit 9468f35c authored by David Schäfer's avatar David Schäfer
Browse files

renamed registered functions

parent da10e27d
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ from saqc.lib.tools import ( ...@@ -17,7 +17,7 @@ from saqc.lib.tools import (
) )
@register("SoilMoistureSpikes") @register("soilMoisture_spikes")
def flagSoilMoistureSpikes( def flagSoilMoistureSpikes(
data, data,
field, field,
...@@ -53,7 +53,7 @@ def flagSoilMoistureSpikes( ...@@ -53,7 +53,7 @@ def flagSoilMoistureSpikes(
) )
@register("SoilMoistureBreaks") @register("soilMoisture_breaks")
def flagSoilMoistureBreaks( def flagSoilMoistureBreaks(
data, data,
field, field,
...@@ -95,7 +95,7 @@ def flagSoilMoistureBreaks( ...@@ -95,7 +95,7 @@ def flagSoilMoistureBreaks(
) )
@register("SoilMoistureByFrost") @register("soilMoisture_frost")
def flagSoilMoistureBySoilFrost( def flagSoilMoistureBySoilFrost(
data, data,
field, field,
...@@ -145,7 +145,7 @@ def flagSoilMoistureBySoilFrost( ...@@ -145,7 +145,7 @@ def flagSoilMoistureBySoilFrost(
return data, flagger return data, flagger
# wrap around df.index.get_loc method, to catch key error in case of empty tolerance window: # wrap around df.index.get_loc method, to catch key error in case of empty tolerance window:
def check_nearest_for_frost(ref_date, ref_series, tolerance, check_level): def _checkNearestForFrost(ref_date, ref_series, tolerance, check_level):
try: try:
# if there is no reference value within tolerance margin, following line will raise key error and # if there is no reference value within tolerance margin, following line will raise key error and
...@@ -164,14 +164,14 @@ def flagSoilMoistureBySoilFrost( ...@@ -164,14 +164,14 @@ def flagSoilMoistureBySoilFrost(
temp_frame = pd.Series(data.index) temp_frame = pd.Series(data.index)
# get flagging mask ("True" denotes "bad"="test succesfull") # get flagging mask ("True" denotes "bad"="test succesfull")
mask = temp_frame.apply( mask = temp_frame.apply(
check_nearest_for_frost, args=(refseries, tolerated_deviation, frost_level) _checkNearestForFrost, args=(refseries, tolerated_deviation, frost_level)
) )
# apply calculated flags # apply calculated flags
flagger = flagger.setFlags(field, mask.values, **kwargs) flagger = flagger.setFlags(field, mask.values, **kwargs)
return data, flagger return data, flagger
@register("SoilMoistureByPrecipitation") @register("soilMoisture_precipitation")
def flagSoilMoistureByPrecipitationEvents( def flagSoilMoistureByPrecipitationEvents(
data, data,
field, field,
...@@ -305,6 +305,7 @@ def flagSoilMoistureByPrecipitationEvents( ...@@ -305,6 +305,7 @@ def flagSoilMoistureByPrecipitationEvents(
return data, flagger return data, flagger
@register("soilMoisture_constant")
def flagSoilMoistureByConstantsDetection( def flagSoilMoistureByConstantsDetection(
data, data,
field, field,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment