From 8efbb27fe80e5c126167397fd8aeda1fcb08eb71 Mon Sep 17 00:00:00 2001 From: David Schaefer <david.schaefer@ufz.de> Date: Wed, 27 Nov 2019 22:16:31 +0100 Subject: [PATCH] Update FunctionDescriptions.md --- docs/FunctionDescriptions.md | 154 +++++++++++++++++++++++++++-------- 1 file changed, 119 insertions(+), 35 deletions(-) diff --git a/docs/FunctionDescriptions.md b/docs/FunctionDescriptions.md index a07000185..08a9543a0 100644 --- a/docs/FunctionDescriptions.md +++ b/docs/FunctionDescriptions.md @@ -66,35 +66,70 @@ clear() ### Description Remove all previously set flags. -## force +## `force` + ### Signature ``` force() ``` + +### Parameters +| parameter | data type | default value | description | +| --------- | ----------- | ---- | ----------- | + ### Description -## sliding_outlier +## `sliding_outlier` + ### Signature ``` sliding_outlier(winsz="1h", dx="1h", count=1, deg=1, z=3.5, method="modZ") ``` + +### Parameters +| parameter | data type | default value | description | +| --------- | ----------- | ---- | ----------- | +| winsz | string | `"1h"` | | +| dx | string | `"1h"` | | +| count | integer | `1` | | +| deg | integer | `1"` | | +| z | float | `3.5` | | +| method | string | `"modZ"` | | + ### Description -## mad +## `mad` + ### Signature ``` mad(length, z=3.5, freq=None) ``` + +### Parameters +| parameter | data type | default value | description | +| --------- | ----------- | ---- | ----------- | +| length | | | | +| z | float | `3.5` | | +| freq | | `None` | | + + ### Description -## Spikes_Basic +## `Spikes_Basic` ### Signature ``` Spikes_Basic(thresh, tolerance, window_size) ``` +### Parameters +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| thresh | float | | Minimum jump margin for spikes. See condition (1). | +| tolerance | float | | Range of area, containing al "valid return values". See condition (2). | +| window_size | ftring | | An offset string, denoting the maximal length of "spikish" value courses. See condition (3). | + ### Description A basic outlier test, that is designed to work for harmonized, as well as raw (not-harmonized) data. @@ -120,19 +155,27 @@ outliers, but also plateau-ish value courses. The implementation is a time-window based version of an outlier test from the UFZ Python library, that can be found [here](https://git.ufz.de/chs/python/blob/master/ufz/level1/spike.py). -| parameter | data format | description | -| ------ | ------ | ------ | -| thresh | Float. | Minimum jump margin for spikes. See condition (1). | -| tolerance | Float. | Range of area, containing al "valid return values". See condition (2). | -| window_size | Offset String. | An offset string, denoting the maximal length of "spikish" value courses. See condition (3). | -## Spikes_SpektrumBased +## `Spikes_SpektrumBased` ### Signature ``` Spikes_SpektrumBased(raise_factor=0.15, dev_cont_factor=0.2, noise_barrier=1, noise_window_size="12h", noise_statistic="CoVar", smooth_poly_order=2, filter_window_size=None) ``` + +### Parameters +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| raise_factor | float | `0.15` | Minimum change margin for a datapoint to become a candidate for a spike. See condition (1). | +| dev_cont_factor | float | `0.2` | See condition (2). | +| noise_barrier | float | `1` | Upper bound for noisyness of data surrounding potential spikes. See condition (3).| +| noise_window_range | string | `"12h"` | Range of the timewindow of the "surrounding" data of a potential spike. See condition (3). | +| noise_statistic | string | `"CoVar"` | Operator to calculate noisyness of data, surrounding potential spike. Either "Covar" (=Coefficient od Variation) or "rvar" (=relative Variance).| +| smooth_poly_order | integer | `2` | Order of the polynomial fit, applied for smoothing| +| filter_window_size | string | `None` | Range of the smoothing window. The default value (='None') results in a window range, equalling 3 times the sampling rate and thus including always 3 values in a smoothing window. | + + ### Description The function detects and flags spikes in input data series by evaluating the @@ -166,32 +209,41 @@ Dorigo,W,.... Global Automated Quality Control of In Situ Soil Moisture Data from the international Soil Moisture Network. 2013. Vadoze Zone J. doi:10.2136/vzj2012.0097. -All parameters default to the values given there. -| parameter | data format | description | -| ------ | ------ | ------ | -| raise_factor | Float. (0.15). | Minimum change margin for a datapoint to become a candidate for a spike. See condition (1). | -| dev_cont_factor | Float. (0.2). | See condition (2). | -| noise_barrier| Float. (1). | Upper bound for noisyness of data surrounding potential spikes. See condition (3).| -| noise_window_range| Offset String. ("12h"). | Range of the timewindow of the "surrounding" data of a potential spike. See condition (3). | -| noise_statistic| String. ("CoVar"). | Operator to calculate noisyness of data, surrounding potential spike. Either "Covar" (=Coefficient od Variation) or "rvar" (=relative Variance).| -| smooth_poly_order| Integer. | Order of the polynomial fit, applied for smoothing| -| filter_window_size | Offset String. (None) | Range of the smoothing window. The default value (='None') results in a window range, equalling 3 times the sampling rate and thus including always 3 values in a smoothing window. | - -## constant +## `constant` ### Signature ``` constant(eps, length, thmin=None) ``` + +### Parameters +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| eps | | | | +| length | | | | +| thmin | | `None` | | + ### Description -## constants_varianceBased +## `constants_varianceBased` + ### Signature ``` constants_varianceBased(plateau_window_min="12h", plateau_var_limit=0.0005, var_total_nans=Inf, var_consec_nans=Inf) ``` + +### Parameters + +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| plateau_window_min | string | | Minimum barrier for the duration, values have to be continouos to be plateau canditaes. See condition (1). | +| plateau_var_limit | float | `0.0005` | Barrier, the variance of a group of values must not exceed to be flagged a plateau .See condition (2). | +| var_total_nans | integer | `Inf` | Maximum number of nan values allowed, for a calculated variance to be valid. | +| var_consec_nans | integer | `Inf` | Maximum number of consecutive nan values allowed, for a calculated variance to be valid. | + + ### Description Function flags plateaus/series of constant values. Any set of consecutive values $`x_k,..., x_{k+n}`$ of a timeseries $`x`$ is flagged, if: @@ -200,23 +252,29 @@ $`x_k,..., x_{k+n}`$ of a timeseries $`x`$ is flagged, if: 2. $`\sigma(x_k,..., x_{k+n})`$ < `plateau_var_limit` NOTE, that the dataseries-to-be flagged is supposed to be harmonized to an -equadistant frequencie grid. - -| parameter | data format (default) | description | -| ------ | ------ | ------ | -| plateau_window_min | Offset String. | Minimum barrier for the duration, values have to be continouos to be plateau canditaes. See condition (1). | -| plateau_var_limit | Float. (0.0005). | Barrier, the variance of a group of values must not exceed to be flagged a plateau .See condition (2). | -| var_total_nans | Integer (np.inf) | Maximum number of nan values allowed, for a calculated variance to be valid. | -| var_consec_nans | Integer (np.inf) | Maximum number of consecutive nan values allowed, for a calculated variance to be valid. | +equadistant frequency grid. +## `SoilMoistureSpikes` -## SoilMoistureSpikes ### Signature ``` SoilMoistureSpikes(filter_window_size="3h", raise_factor=0.15, dev_cont_factor=0.2, noise_barrier=1, noise_window_size="12h", noise_statistic="CoVar") ``` + +### Parameters + +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| filter_window_size | string | `"3h"` | | +| raise_factor | float | `0.15` | | +| dev_cont_factor | float | `0.2` | | +| noise_barrier | integer | `1` | | +| noise_window_size | string | `"12h"` | | +| noise_statistic | string | `"CoVar"` | | + + ### Description The Function is just a wrapper around `flagSpikes_spektrumBased`, from the @@ -228,7 +286,8 @@ Data from the international Soil Moisture Network. 2013. Vadoze Zone J. doi:10.2136/vzj2012.0097. -## SoilMoistureBreaks +## `SoilMoistureBreaks` + ### Signature ``` SoilMoistureBreaks(diff_method="raw", filter_window_size="3h", @@ -236,6 +295,22 @@ SoilMoistureBreaks(diff_method="raw", filter_window_size="3h", first_der_window_size="12h", scnd_der_ratio_margin_1=0.05, scnd_der_ratio_margin_2=10, smooth_poly_order=2) ``` + +### Parameters + +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| diff_method | string | `"raw"` | | +| filter_window_size | string | `"3h"` | | +| rel_change_rate_min | float | `0.1` | | +| abs_change_min | float | `0.01` | | +| first_der_factor | integer | `10` | | +| first_der_window_size | string | `"12h"` | | +| scnd_der_ratio_margin_1 | float | `0.05` | | +| scnd_der_ratio_margin_2 | float | `10.0` | | +| smooth_poly_order | integer | `2` | | + + ### Description The Function is just a wrapper around `flagBreaks_spektrumBased`, from the @@ -247,16 +322,25 @@ Data from the international Soil Moisture Network. 2013. Vadoze Zone J. doi:10.2136/vzj2012.0097. -## SoilMoistureByFrost +## `SoilMoistureByFrost` ### Signature ``` SoilMoistureByFrost(soil_temp_reference, tolerated_deviation="1h", frost_level=0) ``` + +### Parameters + +| parameter | data type | default value | description | +| ------ | ------ | ------ | ---- | +| soil_temp_reference | | | | +| tolerated_deviation | string | `"1h"` | | +| frost_level | integer | `0` | | + ### Description -## SoilMoistureByPrecipitation +## `SoilMoistureByPrecipitation` ### Signature ``` SoilMoistureByPrecipitation(prec_reference, sensor_meas_depth=0, -- GitLab