def rethreshold(self, new_threshold, new_threshold_type='<STR_LIT>'):
for family in self.families:<EOL><INDENT>rethresh_detections = []<EOL>for d in family.detections:<EOL><INDENT>if new_threshold_type == '<STR_LIT>' and d.threshold_type == '<STR_LIT>':<EOL><INDENT>new_thresh = (d.threshold /<EOL>d.threshold_input) * new_threshold<EOL><DEDENT>elif new_threshold_type == '<STR_LIT>' and d.threshold_type != '<STR_LIT>':<EOL><INDENT>raise MatchFilterError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>elif new_threshold_type == '<STR_LIT>':<EOL><INDENT>new_thresh = new_threshold<EOL><DEDENT>elif new_threshold_type == '<STR_LIT>':<EOL><INDENT>new_thresh = new_threshold * d.no_chans<EOL><DEDENT>else:<EOL><INDENT>raise MatchFilterError(<EOL>'<STR_LIT>' %<EOL>str(new_threshold_type))<EOL><DEDENT>if d.detect_val >= new_thresh:<EOL><INDENT>d.threshold = new_thresh<EOL>d.threshold_input = new_threshold<EOL>d.threshold_type = new_threshold_type<EOL>rethresh_detections.append(d)<EOL><DEDENT><DEDENT>family.detections = rethresh_detections<EOL><DEDENT>return self<EOL>
Remove detections from the Party that are below a new threshold.

.. Note:: threshold can only be set higher.

.. Warning::
    Works in place on Party.

:type new_threshold: float
:param new_threshold: New threshold level
:type new_threshold_type: str
:param new_threshold_type: Either 'MAD', 'absolute' or 'av_chan_corr'

.. rubric:: Examples

Using the MAD threshold on detections made using the MAD threshold:

>>> party = Party().read()
>>> len(party)
4
>>> party = party.rethreshold(10.0)
>>> len(party)
4
>>> # Note that all detections are self detections


Using the absolute thresholding method on the same Party:

>>> party = Party().read().rethreshold(6.0, 'absolute')
>>> len(party)
1


Using the av_chan_corr method on the same Party:

>>> party = Party().read().rethreshold(0.9, 'av_chan_corr')
>>> len(party)
4