Skip to content
Snippets Groups Projects
Commit e5bb0a52 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

removed superfluid lib method and imports from lib

parent f909e3e5
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ import pandas as pd ...@@ -7,7 +7,7 @@ import pandas as pd
from scipy.signal import savgol_filter from scipy.signal import savgol_filter
from saqc.funcs.register import register from saqc.funcs.register import register
from saqc.lib.tools import retrieveTrustworthyOriginal, offset2periods from saqc.lib.tools import retrieveTrustworthyOriginal
@register("breaks_spektrumBased") @register("breaks_spektrumBased")
......
...@@ -83,7 +83,7 @@ def flagConstant_varianceBased( ...@@ -83,7 +83,7 @@ def flagConstant_varianceBased(
dataseries, data_rate = retrieveTrustworthyOriginal(data, field, flagger) dataseries, data_rate = retrieveTrustworthyOriginal(data, field, flagger)
min_periods = int(offset2periods(plateau_window_min, data_rate)) min_periods = int(np.ceil(pd.Timedelta(plateau_window_min) / pd.Timedelta(data_rate)))
plateaus = dataseries.rolling( plateaus = dataseries.rolling(
window=plateau_window_min, min_periods=min_periods window=plateau_window_min, min_periods=min_periods
......
...@@ -12,9 +12,7 @@ from saqc.funcs.spike_detection import flagSpikes_spektrumBased ...@@ -12,9 +12,7 @@ from saqc.funcs.spike_detection import flagSpikes_spektrumBased
from saqc.funcs.constants_detection import flagConstant_varianceBased from saqc.funcs.constants_detection import flagConstant_varianceBased
from saqc.funcs.register import register from saqc.funcs.register import register
from saqc.lib.tools import ( from saqc.lib.tools import (
estimateSamplingRate, retrieveTrustworthyOriginal
retrieveTrustworthyOriginal,
offset2periods,
) )
......
...@@ -157,17 +157,6 @@ def offset2seconds(offset): ...@@ -157,17 +157,6 @@ def offset2seconds(offset):
return pd.Timedelta.total_seconds(pd.Timedelta(offset)) return pd.Timedelta.total_seconds(pd.Timedelta(offset))
def offset2periods(input_offset, period_offset):
"""Function returns the number of periods of length "periods_offset" that sum up to length "input offset".
(Namely their fraction.)
:param input_offset Offset string or pandas offset object.
:param period_offset Offset string or pandas offset object.
"""
return offset2seconds(input_offset) / offset2seconds(period_offset)
def flagWindow( def flagWindow(
flagger_old, flagger_new, field, direction="fw", window=0, **kwargs flagger_old, flagger_new, field, direction="fw", window=0, **kwargs
) -> pd.Series: ) -> pd.Series:
......
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