Noise Filtering
Noise can be filtered by applying a butterfilter-lowPass combo (assuming varname
is variable to-be-flagged):
qc = qc.processGeneric(varname, target=varname + '_resids', func=lambda x: butterFilter(x, cutoff=cf) - x)
qc = qc.flagByStatLowPass(varname + '_resids', np.std, window=window, sub_window=sub_window, thresh=thresh, subt_thresh=sub_thresh)
qc = qc.transferFlags(field=varname + '_resids', target=varname)
qc = qc.dropFiel(varname + '_resids')
So for revery variable varname
, there are to be set the following parameters:
-
cf
: the cutoff frequency for the butterworth filter -
window
: the windowsize for the low-pass filter applied on the butterworth residues -
sub_window
: windowsize for the sub-checks of the low pass filter -
thresh
: threshold, passing statistic must not exceed in everywindow
-
sub_thresh
: threshold, passing statistic must not exceed in everysub_window