Skip to content

Commit

Permalink
feat: addeduser parameter to set a bound on nsigma based tolerances f…
Browse files Browse the repository at this point in the history
…or 2pi jumps
  • Loading branch information
skhrg committed Dec 19, 2024
1 parent 4670e8e commit 0345386
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sotodlib/tod_ops/jumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def twopi_jumps(
win_size=...,
nsigma=...,
atol=...,
max_tol=...,
fix: Literal[True] = True,
inplace=...,
merge=...,
Expand All @@ -348,6 +349,7 @@ def twopi_jumps(
win_size=...,
nsigma=...,
atol=...,
max_tol=...,
fix: Literal[False] = False,
inplace=...,
merge=...,
Expand All @@ -364,6 +366,7 @@ def twopi_jumps(
win_size: int = 20,
nsigma: float = 5.0,
atol: Optional[Union[float, NDArray[np.floating]]] = None,
max_tol: float = 0.0314,
fix: bool = True,
inplace: bool = False,
merge: bool = True,
Expand Down Expand Up @@ -394,6 +397,9 @@ def twopi_jumps(
If set to None, then nsigma times the WN level of the TOD is used.
Note that in general this is faster than nsigma.
max_tol: Upper bound of the nsigma based thresh.
atol ignores this.
fix: If True the jumps will be fixed by adding N*2*pi at the jump locations.
inplace: If True jumps will be fixed inplace.
Expand Down Expand Up @@ -424,7 +430,7 @@ def twopi_jumps(
atol = nsigma * std_est(
signal.astype(float), ds=win_size * 10, win_size=win_size
)
np.clip(atol, 1e-8, 1e-2)
np.clip(atol, 1e-8, max_tol)

_signal = _filter(signal, **filter_pars)
_signal = np.atleast_2d(_signal)
Expand Down

0 comments on commit 0345386

Please sign in to comment.