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

renamed parameter

parent 2b11487b
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
```
breaks_spektrumBased(thresh_rel=0.1, thresh_abs=0.01,
first_der_factor=10, first_der_window_size="12h",
first_der_factor=10, first_der_window="12h",
scnd_der_ratio_margin_1=0.05, scnd_der_ratio_margin_2=10,
smooth=True, smooth_window="3h", smooth_poly_deg=2,)
```
......@@ -17,7 +17,7 @@ breaks_spektrumBased(thresh_rel=0.1, thresh_abs=0.01,
| thresh_rel | float | `0.1` | Minimum relative difference between two values to consider the latter as break candidate. See condition (1) |
| thresh_abs | float | `0.01` | Minimum relative difference between two values to consider the latter as break candidate. See condition (2) |
| first_der_factor | float | `10` | Factor of the first derivates "arithmetic middle bound". See condition (3). |
| first_der_window_size | [offset string](docs/ParameterDescriptions.md#offset-strings) | `"12h"` | Determining the size of the window, covering all the values included in the the arithmetic middle calculation of condition (3). |
| first_der_window | [offset string](docs/ParameterDescriptions.md#offset-strings) | `"12h"` | Determining the size of the window, covering all the values included in the the arithmetic middle calculation of condition (3). |
| scnd_der_ratio_margin_1 | float | `0.05` | Range of the area, covering all the values of the second derivatives quotient, that are regarded "sufficiently close to 1" for signifying a break. See condition (5). |
| scnd_der_ratio_margin_2 | float | `10.0` | Lower bound for the break succeeding second derivatives quotients. See condition (5). |
| smooth | bool | `True` | Smooth the timeseries before differenciation using the Savitsky-Golay filter |
......@@ -33,7 +33,7 @@ A value $`x_k`$ of a data series $`x`$, is flagged a break, if:
* $`|\frac{x_k - x_{k-1}}{x_k}| >`$ `thresh_rel`
2. $`x_k`$ represents a sufficient absolute jump in the course of data values:
* $`|x_k - x_{k-1}| >`$ `thresh_abs`
3. Let $`X_k`$ be the set of all values that lie within a `first_der_window_size` range around $`x_k`$. Then, for its arithmetic mean $`\bar{X_k}`$, following equation has to hold:
3. Let $`X_k`$ be the set of all values that lie within a `first_der_window` range around $`x_k`$. Then, for its arithmetic mean $`\bar{X_k}`$, following equation has to hold:
* $`|x'_k| >`$ `first_der_factor` $` \times \bar{X_k} `$
4. The second derivations quatients are "sufficiently equalling 1":
* $` 1 -`$ `scnd_der_ratio_margin_1` $`< |\frac{x''_{k-1}}{x_{k''}}| < 1 + `$`scnd_der_ratio_margin_1`
......
......@@ -18,7 +18,7 @@ def flagBreaks_spektrumBased(
thresh_rel=0.1,
thresh_abs=0.01,
first_der_factor=10,
first_der_window_range="12h",
first_der_window="12h",
scnd_der_ratio_margin_1=0.05,
scnd_der_ratio_margin_2=10,
smooth=True,
......@@ -103,10 +103,10 @@ def flagBreaks_spektrumBased(
for brake in breaks.index:
# slice out slice-to-be-filtered (with some safety extension of 12 times the data rate)
slice_start = (
brake - pd.Timedelta(first_der_window_range) - smoothing_periods * pd.Timedelta(data_rate)
brake - pd.Timedelta(first_der_window) - smoothing_periods * pd.Timedelta(data_rate)
)
slice_end = (
brake + pd.Timedelta(first_der_window_range) + smoothing_periods * pd.Timedelta(data_rate)
brake + pd.Timedelta(first_der_window) + smoothing_periods * pd.Timedelta(data_rate)
)
data_slice = dataseries[slice_start:slice_end]
......@@ -127,8 +127,8 @@ def flagBreaks_spektrumBased(
# condition constructing and testing:
test_slice = first_deri_series[
brake
- pd.Timedelta(first_der_window_range): brake
+ pd.Timedelta(first_der_window_range)
- pd.Timedelta(first_der_window): brake
+ pd.Timedelta(first_der_window)
]
test_sum = abs((test_slice.sum() * first_der_factor) / test_slice.size)
......
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