Package adams.data.filter
Class TimeseriesChangeResolution
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<Timeseries>
-
- adams.data.filter.TimeseriesChangeResolution
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Filter>,SizeOfHandler,Filter<Timeseries>,Serializable,Comparable
public class TimeseriesChangeResolution extends AbstractFilter<Timeseries>
Generates a new timeseries with a (user-defined) fixed-length interval between data points.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-no-id-update <boolean> (property: dontUpdateID) If enabled, suppresses updating the ID of adams.data.id.IDHandler data containers. default: false
-interval <double> (property: interval) The new, fixed-length interval between data points in seconds. default: 30.0 minimum: 0.01
-polynomial <int> (property: polynomial) The polynomial for interpolation. default: 2 minimum: 1
- Version:
- $Revision: 7881 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter
AbstractFilter.FilterJob<T extends DataContainer>
-
-
Field Summary
Fields Modifier and Type Field Description protected doublem_Intervalthe new interval in seconds.protected intm_Polynomial-
Fields inherited from class adams.data.filter.AbstractFilter
m_DontUpdateID
-
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 TimeseriesChangeResolution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected List<TimeseriesPoint>getClosestPoints(long timestamp, List<TimeseriesPoint> data, int numpoints)Determines the closest points for the given timestamp.doublegetInterval()Returns the interval (in seconds).intgetPolynomial()Returns the polynomial for interpolation.StringglobalInfo()Returns a string describing the object.protected doubleinterpolate(double timestamp, List<TimeseriesPoint> closest, int poly)Interpolates the value.StringintervalTipText()Returns the tip text for this property.protected doubleL(double timestamp, List<TimeseriesPoint> closest, int m)StringpolynomialTipText()Returns the tip text for this property.protected TimeseriesprocessData(Timeseries data)Performs the actual filtering.voidsetInterval(double value)Sets the interval (in seconds).voidsetPolynomial(int value)Sets the polynomial for interpolation.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
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 class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
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
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractFilter<Timeseries>
-
setInterval
public void setInterval(double value)
Sets the interval (in seconds).- Parameters:
value- the interval
-
getInterval
public double getInterval()
Returns the interval (in seconds).- Returns:
- the interval
-
intervalTipText
public String intervalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPolynomial
public void setPolynomial(int value)
Sets the polynomial for interpolation.- Parameters:
value- the polynomial
-
getPolynomial
public int getPolynomial()
Returns the polynomial for interpolation.- Returns:
- the polynomial
-
polynomialTipText
public String polynomialTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
getClosestPoints
protected List<TimeseriesPoint> getClosestPoints(long timestamp, List<TimeseriesPoint> data, int numpoints)
Determines the closest points for the given timestamp.- Parameters:
timestamp- the timestampdata- the data pointsnumpoints- the number of points to find- Returns:
- the list of closest points
-
L
protected double L(double timestamp, List<TimeseriesPoint> closest, int m)
-
interpolate
protected double interpolate(double timestamp, List<TimeseriesPoint> closest, int poly)Interpolates the value.- Parameters:
timestamp- the timestampclosest- the closest pointspoly- the polynomial- Returns:
- the interpolated value
-
processData
protected Timeseries processData(Timeseries data)
Performs the actual filtering.- Specified by:
processDatain classAbstractFilter<Timeseries>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
-