Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • berntm/saqc
  • rdm-software/saqc
  • schueler/saqc
3 results
Show changes
Commits on Source (2)
......@@ -942,7 +942,8 @@ def spikes_flagBasic(data, field, flagger, thresh, tolerance, window, numba_kick
# define spike testing function to roll with:
def spikeTester(chunk, thresh=thresh, tol=tolerance):
# signum change!!!
chunk_stair = (np.abs(chunk - chunk[-1]) < thresh)[::-1].cumsum()
chunk_stair = (np.sign(chunk[-2] - chunk[-1])*(chunk - chunk[-1]) < thresh)[::-1].cumsum()
#chunk_stair = (np.abs(chunk - chunk[-1]) < thresh)[::-1].cumsum()
initial = np.searchsorted(chunk_stair, 2)
if initial == len(chunk):
return 0
......@@ -957,10 +958,10 @@ def spikes_flagBasic(data, field, flagger, thresh, tolerance, window, numba_kick
engine=None
if roll_mask.sum() > numba_kickin:
engine = 'numba'
result = customRolling(to_roll, window, spikeTester, roll_mask, closed='both', engine=engine)
result = customRolling(to_roll, window, spikeTester, roll_mask, closed='both', engine=engine, min_periods=2)
# correct the result: only those values define plateaus, that do not have
# values at theire left starting point, that belong to other plateaus themselfs:
# values at their left starting point, that belong to other plateaus themself:
def correctResult(result):
for k in range(len(result)):
if result[k] > 0:
......