Package adams.flow.control.plotprocessor
Class SavitzkyGolay
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,ErrorProvider,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,TechnicalInformationHandler,Serializable
public class SavitzkyGolay extends AbstractPlotProcessorWithBuffer<Point2D> implements TechnicalInformationHandler
A processor that applies SavitzkyGolay smoothing.
For more information see:
A. Savitzky, Marcel J.E. Golay (1964). Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry. 36:1627-1639.
William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery (1992). Savitzky-Golay Smoothing Filters.
@article{Savitzky1964, author = {A. Savitzky and Marcel J.E. Golay}, journal = {Analytical Chemistry}, pages = {1627-1639}, title = {Smoothing and Differentiation of Data by Simplified Least Squares Procedures}, volume = {36}, year = {1964}, HTTP = {http://dx.doi.org/10.1021/ac60214a047} } @inbook{Press1992, author = {William H. Press and Saul A. Teukolsky and William T. Vetterling and Brian P. Flannery}, chapter = {14.8}, edition = {Second}, pages = {650-655}, publisher = {Cambridge University Press}, series = {Numerical Recipes in C}, title = {Savitzky-Golay Smoothing Filters}, year = {1992}, PDF = {http://www.nrbook.com/a/bookcpdf/c14-8.pdf} }
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-plot-name-suffix <java.lang.String> (property: plotNameSuffix) The suffix for the plot name; if left empty, the plot container automatically becomes an OVERLAY. default:
-polynomial <int> (property: polynomialOrder) The polynomial order to use, must be at least 2. default: 2 minimum: 2
-derivative <int> (property: derivativeOrder) The order of the derivative to use, >= 0. default: 1 minimum: 0
-left <int> (property: numPointsLeft) The number of points left of a data point, >= 0. default: 3 minimum: 0
-right <int> (property: numPointsRight) The number of points right of a data point, >= 0. default: 3 minimum: 0
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]m_Coefficientsthe calculated coefficients.protected intm_DerivativeOrderthe order of the derivative.protected intm_NumPointsLeftthe number of points to the left of a data point.protected intm_NumPointsRightthe number of points to the right of a data point.protected intm_PolynomialOrderthe polynomial order.-
Fields inherited from class adams.flow.control.plotprocessor.AbstractPlotProcessorWithBuffer
m_Data, m_LastPlot, m_XIndex
-
Fields inherited from class adams.flow.control.plotprocessor.AbstractPlotProcessor
m_LastError, m_PlotNameSuffix
-
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 SavitzkyGolay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.StringderivativeOrderTipText()Returns the tip text for this property.protected List<SequencePlotterContainer>doProcess(SequencePlotterContainer cont)Processes the provided container.intgetDerivativeOrder()Returns the order of the derivative.intgetNumPointsLeft()Returns the number of points to the left of a data point.intgetNumPointsRight()Returns the number of points to the right of a data point.intgetPolynomialOrder()Returns the polynominal order.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.StringnumPointsLeftTipText()Returns the tip text for this property.StringnumPointsRightTipText()Returns the tip text for this property.StringpolynomialOrderTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidresetCoefficients()Resets the coefficients.voidsetDerivativeOrder(int value)Sets the order of the derivative.voidsetNumPointsLeft(int value)Sets the number of points to the left of a data point.voidsetNumPointsRight(int value)Sets the number of points to the right of a data point.voidsetPolynomialOrder(int value)Sets the polynomial order.-
Methods inherited from class adams.flow.control.plotprocessor.AbstractPlotProcessorWithBuffer
cleanUp, postProcess, preProcess
-
Methods inherited from class adams.flow.control.plotprocessor.AbstractPlotProcessor
check, getLastError, getPlotName, getPlotNameSuffix, getPlotType, hasLastError, isValid, plotNameSuffixTipText, process, setPlotNameSuffix
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_PolynomialOrder
protected int m_PolynomialOrder
the polynomial order.
-
m_DerivativeOrder
protected int m_DerivativeOrder
the order of the derivative.
-
m_NumPointsLeft
protected int m_NumPointsLeft
the number of points to the left of a data point.
-
m_NumPointsRight
protected int m_NumPointsRight
the number of points to the right of a data point.
-
m_Coefficients
protected double[] m_Coefficients
the calculated coefficients.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractPlotProcessorWithBuffer<Point2D>
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractPlotProcessorWithBuffer<Point2D>
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractPlotProcessor
-
resetCoefficients
public void resetCoefficients()
Resets the coefficients.
-
setPolynomialOrder
public void setPolynomialOrder(int value)
Sets the polynomial order.- Parameters:
value- the order
-
getPolynomialOrder
public int getPolynomialOrder()
Returns the polynominal order.- Returns:
- the order
-
polynomialOrderTipText
public String polynomialOrderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDerivativeOrder
public void setDerivativeOrder(int value)
Sets the order of the derivative.- Parameters:
value- the order
-
getDerivativeOrder
public int getDerivativeOrder()
Returns the order of the derivative.- Returns:
- the order
-
derivativeOrderTipText
public String derivativeOrderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumPointsLeft
public void setNumPointsLeft(int value)
Sets the number of points to the left of a data point.- Parameters:
value- the number of points
-
getNumPointsLeft
public int getNumPointsLeft()
Returns the number of points to the left of a data point.- Returns:
- the number of points
-
numPointsLeftTipText
public String numPointsLeftTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumPointsRight
public void setNumPointsRight(int value)
Sets the number of points to the right of a data point.- Parameters:
value- the number of points
-
getNumPointsRight
public int getNumPointsRight()
Returns the number of points to the right of a data point.- Returns:
- the number of points
-
numPointsRightTipText
public String numPointsRightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractPlotProcessor- Returns:
- null if no info available, otherwise short string
-
doProcess
protected List<SequencePlotterContainer> doProcess(SequencePlotterContainer cont)
Processes the provided container. Generates new containers if applicable.- Specified by:
doProcessin classAbstractPlotProcessor- Parameters:
cont- the container to process- Returns:
- null if no new containers were produced
-
-