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

add option to not overwrite existing flags to concatFlags

parent 714aac54
No related branches found
No related tags found
14 merge requests!685Release 2.4,!684Release 2.4,!683Fix github ci,!681Pending deprecation for flagCrossStatistics,!679Bump dependencies,!677Make LOF functions policy compliant,!676New config function cov,!670Documentation decorator,!643Test on Python3.11,!642Multivariate Group Functions,!641Allow function arguments in config syntax,!597Add option to pas existing axis object to the plot function,!581Draft: Multivariate plotting,!578Add option to not overwrite existing flags to concatFlags
Pipeline #129654 passed with stages
in 6 minutes and 54 seconds
......@@ -334,9 +334,10 @@ class ResamplingMixin:
"inverse_interpolation",
"match",
] = "match",
freq: Optional[str] = None,
drop: Optional[bool] = False,
squeeze: Optional[bool] = False,
freq: str | None = None,
drop: bool = False,
squeeze: bool = False,
overwrite: bool = True,
**kwargs,
) -> "SaQC":
"""
......@@ -394,6 +395,10 @@ class ResamplingMixin:
If set to `True`, the appended flags frame will be squeezed - resulting in function specific flags informations
getting lost.
overwrite: bool, default True
If set to True, the newly appended flags will overwrite exsiting flags. This might result in a loss of previous
flagging information.
Returns
-------
saqc.SaQC
......@@ -449,13 +454,19 @@ class ResamplingMixin:
raise ValueError(f"unknown method {method}")
history = self._flags.history[field].apply(dummy.index, func, func_kws)
if overwrite is False:
mask = _isflagged(self._flags[target], thresh=kwargs["dfilter"])
history.hist[mask] = np.nan
if squeeze:
history = history.squeeze(raw=True)
meta = {
"func": f"concatFlags({field})",
"args": (field, target),
"func": f"concatFlags",
"args": (field,),
"kwargs": {
"target": target,
"method": method,
"freq": freq,
"drop": drop,
......
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