#NEWLINE# def get_threshold( self , data , sigma = 5.0 ) : #NEWLINE# #INDENT# median = numpy . median ( data ) #NEWLINE# dist = numpy . fabs ( ( data - median ) ) . mean ( ) #NEWLINE# threshold = ( median + ( sigma * dist ) ) #NEWLINE# self . logger . debug ( ( 'calc threshold=%f' % threshold ) ) #NEWLINE# return threshold