def _filterLikelihoods(likelihoods,<EOL>redThreshold=<NUM_LIT>, yellowThreshold=<NUM_LIT>):
redThreshold    = <NUM_LIT:1.0> - redThreshold<EOL>yellowThreshold = <NUM_LIT:1.0> - yellowThreshold<EOL>filteredLikelihoods = [likelihoods[<NUM_LIT:0>]]<EOL>for i, v in enumerate(likelihoods[<NUM_LIT:1>:]):<EOL><INDENT>if v <= redThreshold:<EOL><INDENT>if likelihoods[i] > redThreshold:<EOL><INDENT>filteredLikelihoods.append(v)<EOL><DEDENT>else:<EOL><INDENT>filteredLikelihoods.append(yellowThreshold)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>filteredLikelihoods.append(v)<EOL><DEDENT><DEDENT>return filteredLikelihoods<EOL>
Filter the list of raw (pre-filtered) likelihoods so that we only preserve
sharp increases in likelihood. 'likelihoods' can be a numpy array of floats or
a list of floats.

:returns: A new list of floats likelihoods containing the filtered values.