@_log<EOL><INDENT>def filter_gradient_threshold(self, analyte, win, threshold, recalc=True):<DEDENT>
params = locals()<EOL>del(params['<STR_LIT>'])<EOL>if recalc or not self.grads_calced:<EOL><INDENT>self.grads = calc_grads(self.Time, self.focus,<EOL>[analyte], win)<EOL>self.grads_calced = True<EOL><DEDENT>below, above = filters.threshold(abs(self.grads[analyte]), threshold)<EOL>setn = self.filt.maxset + <NUM_LIT:1><EOL>self.filt.add(analyte + '<STR_LIT>',<EOL>below,<EOL>'<STR_LIT>'.format(threshold) + analyte,<EOL>params, setn=setn)<EOL>self.filt.add(analyte + '<STR_LIT>',<EOL>above,<EOL>'<STR_LIT>'.format(threshold) + analyte,<EOL>params, setn=setn)<EOL>
Apply gradient threshold filter.

Generates threshold filters for the given analytes above and below
the specified threshold.

Two filters are created with prefixes '_above' and '_below'.
    '_above' keeps all the data above the threshold.
    '_below' keeps all the data below the threshold.

i.e. to select data below the threshold value, you should turn the
'_above' filter off.

Parameters
----------
analyte : str
    Description of `analyte`.
threshold : float
    Description of `threshold`.
win : int
    Window used to calculate gradients (n points)
recalc : bool
    Whether or not to re-calculate the gradients.

Returns
-------
None