org.virbo.dsutil
Class BinAverage

java.lang.Object
  extended by org.virbo.dsutil.BinAverage

public class BinAverage
extends java.lang.Object


Method Summary
static DDataSet boxcar(QDataSet ds, int size)
          run boxcar average over the dataset, returning a dataset of same geometry.
static QDataSet rebin(QDataSet ds, int binSize0)
          reduce the rank 1 dataset by averaging blocks of bins together
static QDataSet rebin(QDataSet ds, int binSize0, int binSize1)
          reduce the rank 2 dataset by averaging blocks of bins together.
static DDataSet rebin(QDataSet ds, QDataSet newTags0)
          returns a dataset with tags specified by newTags0.
static DDataSet rebin(QDataSet ds, QDataSet newTags0, QDataSet newTags1)
          returns a dataset with tags specified by newTags
static QDataSet residuals(QDataSet ds, int boxcarSize)
          returns number of stddev from adjacent data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

rebin

public static DDataSet rebin(QDataSet ds,
                             QDataSet newTags0)
returns a dataset with tags specified by newTags0. Data from ds are averaged together when they fall into the same bin.

Parameters:
ds - a rank 1 dataset, no fill
newTags0 - a rank 1 tags dataset, that must be MONOTONIC.
Returns:
rank 1 dataset with DEPEND_0 = newTags.

rebin

public static DDataSet rebin(QDataSet ds,
                             QDataSet newTags0,
                             QDataSet newTags1)
returns a dataset with tags specified by newTags

Parameters:
ds - a rank 2 dataset.
newTags0 - rank 1 monotonic dataset
newTags1 - rank 1 monotonic dataset
Returns:
rank 2 dataset with newTags0 for the DEPEND_0 tags, newTags1 for the DEPEND_1 tags.

residuals

public static QDataSet residuals(QDataSet ds,
                                 int boxcarSize)
returns number of stddev from adjacent data.

Parameters:
ds, - rank 1 dataset.
boxcarSize -
Returns:
QDataSet

boxcar

public static DDataSet boxcar(QDataSet ds,
                              int size)
run boxcar average over the dataset, returning a dataset of same geometry. Points near the edge are simply copied from the source dataset. The result dataset contains a property "weights" that is the weights for each point.

Parameters:
ds - a rank 1 dataset of size N
size - the number of adjacent bins to average
Returns:
rank 1 dataset of size N

rebin

public static QDataSet rebin(QDataSet ds,
                             int binSize0)
reduce the rank 1 dataset by averaging blocks of bins together

Parameters:
ds - rank 1 dataset with N points
binSize0 - number of adjacent bins to reduce.
Returns:
rank 1 dataset with N/binSize0 points. Weights plane added.

rebin

public static QDataSet rebin(QDataSet ds,
                             int binSize0,
                             int binSize1)
reduce the rank 2 dataset by averaging blocks of bins together. depend datasets reduced as well.

Parameters:
ds - rank 2 dataset with M by N points
binSize0 -
binSize1 -
Returns:
rank 2 dataset with M/binSize0 by N/binSize1 points, with a weights plane.