java.lang.Object
eu.bengreen.data.utility.DownSampleImpl
eu.bengreen.data.utility.LargestTriangleThreeBucketsTime
All Implemented Interfaces:
DownSampler

public class LargestTriangleThreeBucketsTimeextends DownSampleImpl
A variation of the Largest-Triangle-Three-Buckets.

Modified by Fabrice Bacchella for NaN support.

  • Constructor Details

    • LargestTriangleThreeBucketsTime

      public LargestTriangleThreeBucketsTime(int threshold)
      Builds a downsampler that reduces a time series to the requested point count.
      Parameters:
      threshold - the number of points to downsize the series to
  • Method Details

    • downsizeImpl

      public DownSampler.DataSet downsizeImpl(DownSampler.DataSet sampled, long[] timestamps, double[] values)
      Keeps the largest-area point of each time bucket, preserving the series shape.
      Specified by:
      downsizeImpl in class DownSampleImpl
      Parameters:
      sampled - the empty output set allocated by DownSampleImpl.downsize(long[], double[]), holding exactly threshold timestamp and value slots to fill
      timestamps - the full source timestamps in seconds since the epoch, more than threshold in number
      values - the full source values, the same length as timestamps
      Returns:
      the same sampled set, with the threshold chosen ranks written into it