Class SlidingWindow

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.ShallowCopySupporter<adams.data.smoothing.AbstractSmoother>, adams.core.SizeOfHandler, Serializable, Comparable

    public class SlidingWindow
    extends adams.data.smoothing.AbstractSlidingWindow<Spectrum>
    Uses a sliding window for determining the median/average inside the window. This measure is then used as new abundance for the spectrum point in the center of the window. The left and the right ends of the chromatogram are filled with dummy spectrum points to return a chromatogram with the same number of spectrum points.

    Valid options are:

    -D (property: debug)
             If set to true, scheme may output additional info to the console.
     
    -window <int> (property: windowSize)
             The window size for determining the 'smoothed' abundances.
             default: 20
     
    -measure <MEDIAN|MEAN> (property: measure)
             The measure to use for calculating the 'smoothed' abundances.
             default: MEDIAN
     
    Version:
    $Revision: 2242 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.data.smoothing.AbstractSlidingWindow

        adams.data.smoothing.AbstractSlidingWindow.Measure
      • Nested classes/interfaces inherited from class adams.data.smoothing.AbstractSmoother

        adams.data.smoothing.AbstractSmoother.SmootherJob<T extends adams.data.container.DataContainer>
    • Field Summary

      • Fields inherited from class adams.data.smoothing.AbstractSlidingWindow

        m_Measure, m_WindowSize
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      SlidingWindow()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Double getValue​(adams.data.container.DataPoint point)
      Returns the X-value of the data point.
      String globalInfo()
      Returns a string describing the object.
      protected void updatePoint​(adams.data.container.DataPoint point, double value)
      Updates the X-value of the data point.
      • Methods inherited from class adams.data.smoothing.AbstractSlidingWindow

        defineOptions, getMeasure, getWindowSize, measureTipText, processData, setMeasure, setWindowSize, windowSizeTipText
      • Methods inherited from class adams.data.smoothing.AbstractSmoother

        checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getSmoothers, reset, shallowCopy, shallowCopy, smooth
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Constructor Detail

      • SlidingWindow

        public SlidingWindow()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • getValue

        protected Double getValue​(adams.data.container.DataPoint point)
        Returns the X-value of the data point.
        Specified by:
        getValue in class adams.data.smoothing.AbstractSlidingWindow<Spectrum>
        Parameters:
        point - the point to get the X-value from
        Returns:
        the X-value
      • updatePoint

        protected void updatePoint​(adams.data.container.DataPoint point,
                                   double value)
        Updates the X-value of the data point.
        Specified by:
        updatePoint in class adams.data.smoothing.AbstractSlidingWindow<Spectrum>
        Parameters:
        point - the point to update
        value - the value to update the point with