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 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
    • 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).
        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 timestamp
        data - the data points
        numpoints - the number of points to find
        Returns:
        the list of closest points
      • interpolate

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