Class 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 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
    $Revision: 7881 $
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Interval

        protected double m_Interval
        the new interval in seconds.
      • m_Polynomial

        protected int m_Polynomial
    • Constructor Detail

      • TimeseriesChangeResolution

        public TimeseriesChangeResolution()
    • Method Detail

      • setInterval

        public void setInterval​(double value)
        Sets the interval (in seconds).
        value - the interval
      • getInterval

        public double getInterval()
        Returns the interval (in seconds).
        the interval
      • intervalTipText

        public String intervalTipText()
        Returns the tip text for this property.
        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.
        value - the polynomial
      • getPolynomial

        public int getPolynomial()
        Returns the polynomial for interpolation.
        the polynomial
      • polynomialTipText

        public String polynomialTipText()
        Returns the tip text for this property.
        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.
        timestamp - the timestamp
        data - the data points
        numpoints - the number of points to find
        the list of closest points
      • interpolate

        protected double interpolate​(double timestamp,
                                     List<TimeseriesPoint> closest,
                                     int poly)
        Interpolates the value.
        timestamp - the timestamp
        closest - the closest points
        poly - the polynomial
        the interpolated value