Skip to content

Draft: WIP: flagging plateaus

Peter Lünenschloß requested to merge flagOffsetsImplementation into develop

Adding wavelet-based flagging of outlierish plateaus.

Based on the idea of searching for ricker-wavelet patterns, at decompositionscales generated by themselfs, a quite powerful, parameter minimal algorithm/workflow was sketched out and implemented.

Based only on the minimal and maximal length of plateus to be detected, the algorithm seems to perform well on highly volatile and noisy test data.

Example

Example data set was generated by

  1. generating noisy baseline, adding offsets and outliers (base1)
  2. adding some cosine variance to the data (base2)
  3. adding highly volatile, real world turbidity meassurements to the data (base3)

syntheticData

Flagging result for the call:

qc = qc.flagPlateau('base3', min_length='100min', max_length='7d')

Looks as follows (overview):

offsetresult1

Zoomed in on the flagged chunks:

offsetResult5

offsetresult4

offsetResult3

offsetResult2

Evaluation

This good results, with:

  1. parameter minimal application
  2. no overflagging
  3. quite precise flagging of targeted anomalies

comes at some hefty numerical costs, due to the auto search at the different wavelet scales. Result for the example data needed ~2 minutes of calculation (25000 periods).

To Do

To speed that up, the function scaleScoring needs some cython or numba boosted modification.

Also the code needs cleanup and refactoring.

Edited by Peter Lünenschloß

Merge request reports