parameters: (self, signal, width)
return_statement: return signal
docstring: Bragg peaks are located as outliers in some moving window
          Outliers are defined as values more than 3sigma away from the median
          Sigma is estimated using 1.4826*MAD
          Returns median+2.2*MAD of window for values detected to be outliers
          Input dataset (dset) and window width (x)
          Input an odd window or the window will be asymmetric and stuff breaks
docstring_summary: Bragg peaks are located as outliers in some moving window
          Outliers are defined as values more than 3sigma away from the median
          Sigma is estimated using 1.4826*MAD
          Returns median+2.2*MAD of window for values detected to be outliers
          Input dataset (dset) and window width (x)
          Input an odd window or the window will be asymmetric and stuff breaks
docstring_tokens: Bragg peaks are located as outliers in some moving window Outliers are defined as values more than 3sigma away from the median Sigma is estimated using 1 . 4826 * MAD Returns median + 2 . 2 * MAD of window for values detected to be outliers Input dataset ( dset ) and window width ( x ) Input an odd window or the window will be asymmetric and stuff breaks
function: def _karen(self, signal, width):
          """
          Bragg peaks are located as outliers in some moving window
          Outliers are defined as values more than 3sigma away from the median
          Sigma is estimated using 1.4826*MAD
          Returns median+2.2*MAD of window for values detected to be outliers
          Input dataset (dset) and window width (x)
          Input an odd window or the window will be asymmetric and stuff breaks
          """
          med = ndimage.filters.median_filter(signal, size=width, mode='nearest') # Get median of input data set
          mad = ndimage.filters.median_filter(np.abs(signal-med), size=width, mode='nearest') # Get median absolute deviation (MAD)
          asigma = np.abs(mad*3*1.4826) # Absolute value of approximate sigma
          mask = np.logical_or(signal < (med-asigma), signal > (med+asigma)) # Check if value is outlier based on MAD
          signal[mask] = (med+2.2*mad)[mask] # Return median+2.2*MAD if value is outlier
          return signal
function_tokens: def _karen ( self , signal , width ) : med = ndimage . filters . median_filter ( signal , size = width , mode = 'nearest' ) # Get median of input data set mad = ndimage . filters . median_filter ( np . abs ( signal - med ) , size = width , mode = 'nearest' ) # Get median absolute deviation (MAD) asigma = np . abs ( mad * 3 * 1.4826 ) # Absolute value of approximate sigma mask = np . logical_or ( signal < ( med - asigma ) , signal > ( med + asigma ) ) # Check if value is outlier based on MAD signal [ mask ] = ( med + 2.2 * mad ) [ mask ] # Return median+2.2*MAD if value is outlier return signal