org.virbo.dsops
Class Ops

java.lang.Object
  extended by org.virbo.dsops.Ops

public class Ops
extends java.lang.Object

A fairly complete set of operations for QDataSets. Currently, most operations require that the dataset be a qube. Most operations check for fill data. Few operations check units. (TODO: check units)


Nested Class Summary
static interface Ops.BinaryOp
           
static interface Ops.UnaryOp
           
 
Field Summary
static double E
           
static double PI
           
 
Constructor Summary
Ops()
           
 
Method Summary
static QDataSet abs(QDataSet ds1)
          element-wise abs.
static QDataSet acos(QDataSet ds)
          element-wise acos.
static QDataSet add(QDataSet ds1, QDataSet ds2)
          add the two datasets have the same geometry.
static QDataSet and(QDataSet ds1, QDataSet ds2)
           
static QDataSet applyBinaryOp(QDataSet ds1, double d2, Ops.BinaryOp op)
           
static QDataSet applyBinaryOp(QDataSet ds1, QDataSet ds2, Ops.BinaryOp op)
          apply the binary operator element-for-element of the two datasets, minding dataset geometry, fill values, etc.
static DDataSet applyUnaryOp(QDataSet ds1, Ops.UnaryOp op)
          apply the unary operation (such as "cos") to the dataset.
static QDataSet asin(QDataSet ds)
          element-wise sin.
static QDataSet atan(QDataSet ds)
          element-wise atan.
static QDataSet atan2(QDataSet dsy, QDataSet dsx)
          element-wise atan2, 4-quadrant atan.
static QDataSet ceil(QDataSet ds1)
           
static QDataSet concatenate(QDataSet ds1, QDataSet ds2)
          concatenates the two datasets together, appending the on the zeroth dimension.
static QDataSet copysign(QDataSet magnitude, QDataSet sign)
          Returns the first floating-point argument with the sign of the second floating-point argument.
static QDataSet cos(QDataSet ds)
          element-wise cos.
static QDataSet cosh(QDataSet ds)
          element-wise cosh.
static QDataSet dblarr(int len0)
          create a dataset filled with zeros.
static QDataSet dblarr(int len0, int len1)
           
static QDataSet dblarr(int len0, int len1, int len2)
           
static QDataSet diff(QDataSet ds)
          return array that is the differences between each successive pair in the dataset.
static QDataSet dindgen(int len0)
          returns rank 1 dataset with values [0,1,2,...]
static QDataSet dindgen(int len0, int len1)
          returns rank 2 dataset with values increasing [ [0,1,2], [ 3,4,5] ]
static QDataSet dindgen(int len0, int len1, int len2)
          returns rank 3 dataset with values increasing
static QDataSet div(QDataSet ds1, QDataSet ds2)
          element-wise div of two datasets with the same geometry.
static QDataSet divide(QDataSet ds1, QDataSet ds2)
          element-wise divide of two datasets with the same geometry.
static QDataSet eq(QDataSet ds1, QDataSet ds2)
          element-wise equality test.
static QDataSet exp(QDataSet ds)
          element-wise exponentiate e**x.
static QDataSet exp10(QDataSet ds)
          element-wise exponentiate 10**x.
static QDataSet expm1(QDataSet ds)
          Returns ex -1.
static QDataSet extent(QDataSet ds)
          returns a two element, rank 1 dataset containg the extent of the data.
static QDataSet fft(QDataSet ds)
          Performs an FFT on the provided rank 1 dataset.
static QDataSet fftWindow(QDataSet ds, int len)
          perform ffts on the rank 1 dataset to make a rank2 spectrogram.
static QDataSet findex(QDataSet uu, QDataSet vv)
          returns the floating point index of each element of vv within the monotonically increasing dataset uu.
static QDataSet findgen(int len0)
          returns rank 1 dataset with values [0,1,2,...]
static QDataSet findgen(int len0, int len1)
          returns rank 2 dataset with values increasing [ [0,1,2], [ 3,4,5] ]
static QDataSet findgen(int len0, int len1, int len2)
          returns rank 3 dataset with values increasing
static QDataSet floor(QDataSet ds1)
           
static QDataSet fltarr(int len0)
          create a dataset filled with zeros.
static QDataSet fltarr(int len0, int len1)
           
static QDataSet fltarr(int len0, int len1, int len2)
           
static QDataSet ge(QDataSet ds1, QDataSet ds2)
           
static QDataSet gt(QDataSet ds1, QDataSet ds2)
           
static QDataSet histogram(QDataSet ds, double min, double max, double binSize)
          returns histogram of dataset, the number of points falling in each bin.
static QDataSet histogram(QDataSet ds, int binCount)
          returns a histogram of the dataset, based on the extent and scaletype of the data.
static QDataSet interpolate(QDataSet vv, QDataSet findex)
          interpolate values from rank 1 dataset vv using fractional indeces in rank N findex.
static QDataSet interpolate(QDataSet vv, QDataSet findex0, QDataSet findex1)
          interpolate values from rank 1 dataset vv using fractional indeces in rank N findex, using bilinear interpolation.
static QDataSet join(QDataSet ds1, QDataSet ds2)
          Join two rank N datasets to make a rank N+1 dataset, with the first dimension having two elements.
static QDataSet labels(java.lang.String[] labels)
          create a labels dataset for tagging rows of a dataset.
static QDataSet labels(java.lang.String[] labels, java.lang.String context)
          create a labels dataset for tagging rows of a dataset.
static QDataSet le(QDataSet ds1, QDataSet ds2)
           
static QDataSet linspace(double min, double max, int len0)
          return a rank 1 dataset with len0 linearly-spaced values, the first is min and the last is max.
static QDataSet log(QDataSet ds)
          element-wise natural logarythm.
static QDataSet log10(QDataSet ds)
          element-wise base 10 logarythm.
static QDataSet lt(QDataSet ds1, QDataSet ds2)
           
static QDataSet magnitude(QDataSet ds)
          return the magnitudes of vectors in a rank 2 or greater dataset.
static QDataSet mod(QDataSet ds1, QDataSet ds2)
          element-wise mod of two datasets with the same geometry.
static QDataSet multiply(QDataSet ds1, QDataSet ds2)
          element-wise multiply of two datasets with the same geometry.
static QDataSet ne(QDataSet ds1, QDataSet ds2)
          element-wise not equal test.
static QDataSet negate(QDataSet ds1)
          return a dataset with each element negated.
static QDataSet not(QDataSet ds1)
           
static QDataSet ones(int len0)
          return new dataset filled with ones.
static QDataSet ones(int len0, int len1)
          return new dataset filled with ones.
static QDataSet ones(int len0, int len1, int len2)
          return new dataset filled with ones.
static QDataSet or(QDataSet ds1, QDataSet ds2)
           
static QDataSet outerProduct(QDataSet ds1, QDataSet ds2)
          returns outerProduct of two rank 1 datasets, a rank 2 dataset with elements R[i,j]= ds1[i] * ds2[j].
static QDataSet pow(QDataSet ds1, double pow)
          element-wise pow.
static QDataSet pow(QDataSet ds1, QDataSet pow)
          element-wise pow (** in FORTRAN, ^ in IDL) of two datasets with the same geometry.
static QDataSet rand(int len0)
          return returns a rank 1 dataset of random uniform numbers from [0,1].
static QDataSet rand(int len0, int len1)
          return returns a rank 2 dataset of random uniform numbers from [0,1].
static QDataSet rand(int len0, int len1, int len2)
          return returns a rank 3 dataset of random uniform numbers from [0,1].
static QDataSet randn(int len0)
          return returns a rank 1 dataset of random numbers of a guassian (normal) distribution.
static QDataSet randn(int len0, int len1)
          return returns a rank 2 dataset of random numbers of a guassian (normal) distribution.
static QDataSet randn(int len0, int len1, int len2)
          return returns a rank 3 dataset of random numbers of a guassian (normal) distribution.
static QDataSet randomn(long seed, int len0)
          returns a rank 1 dataset of random numbers of a guassian (normal) distribution.
static QDataSet randomn(long seed, int len0, int len1)
          returns a rank 2 dataset of random numbers of a guassian (normal) distribution.
static QDataSet randomn(long seed, int len0, int len1, int len2)
          returns a rank 3 dataset of random numbers of a guassian (normal) distribution.
static QDataSet reduceMax(QDataSet ds, int dim)
          reduce the dataset's rank by reporting the max of all the elements along a dimension.
static QDataSet reduceMean(QDataSet ds, int dim)
          reduce the dataset's rank by reporting the max of all the elements along a dimension.
static QDataSet reduceMin(QDataSet ds, int dim)
          reduce the dataset's rank by reporting the min of all the elements along a dimension.
static QDataSet reform(QDataSet ds)
          Reshape the dataset to remove the first dimension with length 1, reducing its rank by 1.
static QDataSet reform(QDataSet ds, int[] qube)
           
static QDataSet replicate(double val, int len0)
          returns rank 1 dataset with value
static QDataSet replicate(double val, int len0, int len1)
          returns rank 2 dataset filled with value
static QDataSet replicate(double val, int len0, int len1, int len2)
          returns rank 3 dataset with filled with value.
static QDataSet replicate(float val, int len0)
          returns rank 1 dataset with value
static QDataSet replicate(float val, int len0, int len1)
          returns rank 2 dataset filled with value
static QDataSet replicate(float val, int len0, int len1, int len2)
          returns rank 3 dataset with filled with value.
static QDataSet shuffle(QDataSet ds)
          returns a rank 1 dataset of indeces that shuffle the rank 1 dataset ds
static QDataSet signum(QDataSet ds1)
          Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero.
static QDataSet sin(QDataSet ds)
          element-wise sin.
static QDataSet sinh(QDataSet ds)
          element-wise sinh.
static QDataSet smooth(QDataSet ds, int size)
          run boxcar average over the dataset, returning a dataset of same geometry.
static QDataSet sort(QDataSet ds)
          returns a rank 1 dataset of indeces that sort the rank 1 dataset ds.
static QDataSet sqrt(QDataSet ds)
          element-wise sqrt.
static QDataSet subtract(QDataSet ds1, QDataSet ds2)
          subtract one dataset from another.
static QDataSet tan(QDataSet ds)
          element-wise tan.
static QDataSet tanh(QDataSet ds)
          element-wise tanh.
static QDataSet timegen(java.lang.String baseTime, java.lang.String cadence, int len0)
          returns rank 1 dataset with values [0,1,2,...]
static QDataSet toDegrees(QDataSet ds)
           
static QDataSet toRadians(QDataSet ds)
           
static double total(QDataSet ds)
           
static QDataSet total(QDataSet ds, int dim)
          reduce the dataset's rank by totalling all the elements along a dimension.
static QDataSet transpose(QDataSet ds)
           
static QDataSet where(QDataSet ds)
          returns a dataset containing the indeces of where the dataset is non-zero.
static QDataSet zeros(int len0)
          return new dataset filled with zeros.
static QDataSet zeros(int len0, int len1)
          return new dataset filled with zeros.
static QDataSet zeros(int len0, int len1, int len2)
          return new dataset filled with zeros.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PI

public static double PI

E

public static double E
Constructor Detail

Ops

public Ops()
Method Detail

applyUnaryOp

public static final DDataSet applyUnaryOp(QDataSet ds1,
                                          Ops.UnaryOp op)
apply the unary operation (such as "cos") to the dataset. DEPEND_* is propogated.

Parameters:
ds1 -
op -
Returns:

applyBinaryOp

public static final QDataSet applyBinaryOp(QDataSet ds1,
                                           QDataSet ds2,
                                           Ops.BinaryOp op)
apply the binary operator element-for-element of the two datasets, minding dataset geometry, fill values, etc.

Parameters:
ds1 -
ds2 -
op -
Returns:

applyBinaryOp

public static final QDataSet applyBinaryOp(QDataSet ds1,
                                           double d2,
                                           Ops.BinaryOp op)

add

public static QDataSet add(QDataSet ds1,
                           QDataSet ds2)
add the two datasets have the same geometry.

Parameters:
ds1 -
ds2 -
Returns:

subtract

public static QDataSet subtract(QDataSet ds1,
                                QDataSet ds2)
subtract one dataset from another. TODO: mind units

Parameters:
ds1 -
ds2 -
Returns:

negate

public static QDataSet negate(QDataSet ds1)
return a dataset with each element negated.

Parameters:
ds1 -
Returns:

magnitude

public static QDataSet magnitude(QDataSet ds)
return the magnitudes of vectors in a rank 2 or greater dataset. The last index must be a cartesian dimension, so it must have a depend dataset either named "cartesian" or having the property CARTESIAN_FRAME

Parameters:
ds - of Rank N.
Returns:
ds of Rank N-1.

total

public static double total(QDataSet ds)

total

public static QDataSet total(QDataSet ds,
                             int dim)
reduce the dataset's rank by totalling all the elements along a dimension. Only QUBEs are supported presently.

Parameters:
ds - rank N qube dataset.
dim - zero-based index number.
normalize - return the average instead of the total.
Returns:

reduceMax

public static QDataSet reduceMax(QDataSet ds,
                                 int dim)
reduce the dataset's rank by reporting the max of all the elements along a dimension. Only QUBEs are supported presently.

Parameters:
ds - rank N qube dataset.
dim - zero-based index number.
Returns:

reduceMin

public static QDataSet reduceMin(QDataSet ds,
                                 int dim)
reduce the dataset's rank by reporting the min of all the elements along a dimension. Only QUBEs are supported presently.

Parameters:
ds - rank N qube dataset.
dim - zero-based index number.
Returns:

reduceMean

public static QDataSet reduceMean(QDataSet ds,
                                  int dim)
reduce the dataset's rank by reporting the max of all the elements along a dimension. Only QUBEs are supported presently.

Parameters:
ds - rank N qube dataset.
dim - zero-based index number.
Returns:

sqrt

public static QDataSet sqrt(QDataSet ds)
element-wise sqrt.

Parameters:
ds -
Returns:

abs

public static QDataSet abs(QDataSet ds1)
element-wise abs. For vectors, this returns the length of each element.

Parameters:
ds1 -
Returns:

pow

public static QDataSet pow(QDataSet ds1,
                           double pow)
element-wise pow. (** in FORTRAN, ^ in IDL)

Parameters:
ds1 -
pow -
Returns:

pow

public static QDataSet pow(QDataSet ds1,
                           QDataSet pow)
element-wise pow (** in FORTRAN, ^ in IDL) of two datasets with the same geometry.

Parameters:
ds1 -
pow -
Returns:

exp

public static QDataSet exp(QDataSet ds)
element-wise exponentiate e**x.

Parameters:
ds -
Returns:

exp10

public static QDataSet exp10(QDataSet ds)
element-wise exponentiate 10**x.

Parameters:
ds -
Returns:

log

public static QDataSet log(QDataSet ds)
element-wise natural logarythm.

Parameters:
ds -
Returns:

log10

public static QDataSet log10(QDataSet ds)
element-wise base 10 logarythm.

Parameters:
ds -
Returns:

multiply

public static QDataSet multiply(QDataSet ds1,
                                QDataSet ds2)
element-wise multiply of two datasets with the same geometry.

Parameters:
ds -
Returns:

divide

public static QDataSet divide(QDataSet ds1,
                              QDataSet ds2)
element-wise divide of two datasets with the same geometry.

Parameters:
ds -
Returns:

mod

public static QDataSet mod(QDataSet ds1,
                           QDataSet ds2)
element-wise mod of two datasets with the same geometry.

Parameters:
ds -
Returns:

div

public static QDataSet div(QDataSet ds1,
                           QDataSet ds2)
element-wise div of two datasets with the same geometry.

Parameters:
ds -
Returns:

eq

public static QDataSet eq(QDataSet ds1,
                          QDataSet ds2)
element-wise equality test. 1.0 is returned where the two datasets are equal. invalid measurements are always unequal.

Parameters:
ds -
Returns:

ne

public static QDataSet ne(QDataSet ds1,
                          QDataSet ds2)
element-wise not equal test. invalid measurements are always unequal.

Parameters:
ds1 -
ds2 -
Returns:

gt

public static QDataSet gt(QDataSet ds1,
                          QDataSet ds2)

ge

public static QDataSet ge(QDataSet ds1,
                          QDataSet ds2)

lt

public static QDataSet lt(QDataSet ds1,
                          QDataSet ds2)

le

public static QDataSet le(QDataSet ds1,
                          QDataSet ds2)

or

public static QDataSet or(QDataSet ds1,
                          QDataSet ds2)

and

public static QDataSet and(QDataSet ds1,
                           QDataSet ds2)

not

public static QDataSet not(QDataSet ds1)

dindgen

public static QDataSet dindgen(int len0)
returns rank 1 dataset with values [0,1,2,...]

Parameters:
size -
Returns:

dindgen

public static QDataSet dindgen(int len0,
                               int len1)
returns rank 2 dataset with values increasing [ [0,1,2], [ 3,4,5] ]

Parameters:
len0 -
len1 -
Returns:

dindgen

public static QDataSet dindgen(int len0,
                               int len1,
                               int len2)
returns rank 3 dataset with values increasing

Parameters:
len0 -
len1 -
len2 -
Returns:

findgen

public static QDataSet findgen(int len0)
returns rank 1 dataset with values [0,1,2,...]

Parameters:
size -
Returns:

findgen

public static QDataSet findgen(int len0,
                               int len1)
returns rank 2 dataset with values increasing [ [0,1,2], [ 3,4,5] ]

Parameters:
len0 -
len1 -
Returns:

findgen

public static QDataSet findgen(int len0,
                               int len1,
                               int len2)
returns rank 3 dataset with values increasing

Parameters:
len0 -
len1 -
len2 -
Returns:

fltarr

public static QDataSet fltarr(int len0)
create a dataset filled with zeros.

Parameters:
len0 -
Returns:

fltarr

public static QDataSet fltarr(int len0,
                              int len1)

fltarr

public static QDataSet fltarr(int len0,
                              int len1,
                              int len2)

dblarr

public static QDataSet dblarr(int len0)
create a dataset filled with zeros.

Parameters:
len0 -
Returns:

dblarr

public static QDataSet dblarr(int len0,
                              int len1)

dblarr

public static QDataSet dblarr(int len0,
                              int len1,
                              int len2)

timegen

public static QDataSet timegen(java.lang.String baseTime,
                               java.lang.String cadence,
                               int len0)
                        throws java.text.ParseException
returns rank 1 dataset with values [0,1,2,...]

Parameters:
baseTime - e.g. "2003-02-04T00:00"
cadence - e.g. "4.3 sec" "1 day"
len0 - the number of elements.
Returns:
Throws:
java.text.ParseException

linspace

public static QDataSet linspace(double min,
                                double max,
                                int len0)
return a rank 1 dataset with len0 linearly-spaced values, the first is min and the last is max.

Parameters:
min -
max -
len0 -
Returns:

replicate

public static QDataSet replicate(double val,
                                 int len0)
returns rank 1 dataset with value

Parameters:
val - fill the dataset with this value.
len0 -
Returns:

replicate

public static QDataSet replicate(double val,
                                 int len0,
                                 int len1)
returns rank 2 dataset filled with value

Parameters:
val - fill the dataset with this value.
len0 -
len1 -
Returns:

replicate

public static QDataSet replicate(double val,
                                 int len0,
                                 int len1,
                                 int len2)
returns rank 3 dataset with filled with value.

Parameters:
val - fill the dataset with this value.
len0 -
len1 -
len2 -
Returns:

replicate

public static QDataSet replicate(float val,
                                 int len0)
returns rank 1 dataset with value

Parameters:
val - fill the dataset with this value.
len0 -
Returns:

replicate

public static QDataSet replicate(float val,
                                 int len0,
                                 int len1)
returns rank 2 dataset filled with value

Parameters:
val - fill the dataset with this value.
len0 -
len1 -
Returns:

replicate

public static QDataSet replicate(float val,
                                 int len0,
                                 int len1,
                                 int len2)
returns rank 3 dataset with filled with value.

Parameters:
val - fill the dataset with this value.
len0 -
len1 -
len2 -
Returns:

zeros

public static QDataSet zeros(int len0)
return new dataset filled with zeros.

Parameters:
len0 -
Returns:

zeros

public static QDataSet zeros(int len0,
                             int len1)
return new dataset filled with zeros.

Parameters:
len0 -
Returns:

zeros

public static QDataSet zeros(int len0,
                             int len1,
                             int len2)
return new dataset filled with zeros.

Parameters:
len0 -
Returns:

ones

public static QDataSet ones(int len0)
return new dataset filled with ones.

Parameters:
len0 -
Returns:

ones

public static QDataSet ones(int len0,
                            int len1)
return new dataset filled with ones.

Parameters:
len0 -
Returns:

ones

public static QDataSet ones(int len0,
                            int len1,
                            int len2)
return new dataset filled with ones.

Parameters:
len0 -
Returns:

concatenate

public static QDataSet concatenate(QDataSet ds1,
                                   QDataSet ds2)
concatenates the two datasets together, appending the on the zeroth dimension. The two datasets must be QUBES have similar geometry on the higher dimensions. This was briefly known as "join."

Parameters:
ds1 -
ds2 -
Returns:
Throws:
java.lang.IllegalArgumentException - if the two datasets don't have the same rank.

rand

public static QDataSet rand(int len0)
return returns a rank 1 dataset of random uniform numbers from [0,1].


rand

public static QDataSet rand(int len0,
                            int len1)
return returns a rank 2 dataset of random uniform numbers from [0,1].


rand

public static QDataSet rand(int len0,
                            int len1,
                            int len2)
return returns a rank 3 dataset of random uniform numbers from [0,1].


randn

public static QDataSet randn(int len0)
return returns a rank 1 dataset of random numbers of a guassian (normal) distribution.


randn

public static QDataSet randn(int len0,
                             int len1)
return returns a rank 2 dataset of random numbers of a guassian (normal) distribution.


randn

public static QDataSet randn(int len0,
                             int len1,
                             int len2)
return returns a rank 3 dataset of random numbers of a guassian (normal) distribution.


randomn

public static QDataSet randomn(long seed,
                               int len0)
returns a rank 1 dataset of random numbers of a guassian (normal) distribution. System.currentTimeMillis() may be used for the seed.

Parameters:
seed -
len0 -
Returns:

randomn

public static QDataSet randomn(long seed,
                               int len0,
                               int len1)
returns a rank 2 dataset of random numbers of a guassian (normal) distribution.

Parameters:
seed -
len0 -
len1 -
Returns:

randomn

public static QDataSet randomn(long seed,
                               int len0,
                               int len1,
                               int len2)
returns a rank 3 dataset of random numbers of a guassian (normal) distribution.

Parameters:
seed -
len0 -
len1 -
len2 -
Returns:

sin

public static QDataSet sin(QDataSet ds)
element-wise sin.

Parameters:
ds -
Returns:

asin

public static QDataSet asin(QDataSet ds)
element-wise sin.

Parameters:
ds -
Returns:

cos

public static QDataSet cos(QDataSet ds)
element-wise cos.

Parameters:
ds -
Returns:

acos

public static QDataSet acos(QDataSet ds)
element-wise acos.

Parameters:
ds -
Returns:

tan

public static QDataSet tan(QDataSet ds)
element-wise tan.

Parameters:
ds -
Returns:

atan

public static QDataSet atan(QDataSet ds)
element-wise atan.

Parameters:
ds -
Returns:

atan2

public static QDataSet atan2(QDataSet dsy,
                             QDataSet dsx)
element-wise atan2, 4-quadrant atan.

Parameters:
dsy -
dsx -
Returns:

cosh

public static QDataSet cosh(QDataSet ds)
element-wise cosh.

Parameters:
ds -
Returns:

sinh

public static QDataSet sinh(QDataSet ds)
element-wise sinh.

Parameters:
ds -
Returns:

tanh

public static QDataSet tanh(QDataSet ds)
element-wise tanh.

Parameters:
ds -
Returns:

expm1

public static QDataSet expm1(QDataSet ds)
Returns ex -1. Note that for values of x near 0, the exact sum of expm1(x) + 1 is much closer to the true result of ex than exp(x).

Parameters:
ds -
Returns:

toRadians

public static QDataSet toRadians(QDataSet ds)

toDegrees

public static QDataSet toDegrees(QDataSet ds)

where

public static QDataSet where(QDataSet ds)
returns a dataset containing the indeces of where the dataset is non-zero. For a rank 1 dataset, returns a rank 1 dataset with indeces for the values. For a higher rank dataset, returns a rank 2 qube dataset with ds.rank() elements in the first dimension.

Parameters:
ds - of any rank M
Returns:
a rank 1 or rank 2 dataset with N by M elements, where N is the number of non-zero elements found.

sort

public static QDataSet sort(QDataSet ds)
returns a rank 1 dataset of indeces that sort the rank 1 dataset ds. This is not the dataset sorted. For example:
   ds= randn(2000)
   s= sort( ds )
   dsSorted= ds[s]
 

Parameters:
ds - rank 1 dataset
Returns:
rank 1 dataset of indeces that sort the input dataset.

shuffle

public static QDataSet shuffle(QDataSet ds)
returns a rank 1 dataset of indeces that shuffle the rank 1 dataset ds
   s= shuffle( ds )
   dsShuffled= ds[s]
 

Parameters:
ds - rank 1 dataset
Returns:
rank 1 dataset of integer indeces.

fft

public static QDataSet fft(QDataSet ds)
Performs an FFT on the provided rank 1 dataset. A rank 2 dataset of complex numbers is returned.

Parameters:
ds - a rank 1 dataset.
Returns:
a rank 2 dataset of complex numbers.

fftWindow

public static QDataSet fftWindow(QDataSet ds,
                                 int len)
perform ffts on the rank 1 dataset to make a rank2 spectrogram.

Parameters:
ds - rank 1 dataset
len - the window length
Returns:
rank 2 dataset.

extent

public static QDataSet extent(QDataSet ds)
returns a two element, rank 1 dataset containg the extent of the data. The property QDataSet.SCALE_TYPE is set to lin or log. The property QDataSet.COUNT is set to the number of valid measurements.

Parameters:
ds -
Returns:
two element, rank 1 dataset.

histogram

public static QDataSet histogram(QDataSet ds,
                                 double min,
                                 double max,
                                 double binSize)
returns histogram of dataset, the number of points falling in each bin.

Parameters:
ds -
min -
max -
binSize -
Returns:

histogram

public static QDataSet histogram(QDataSet ds,
                                 int binCount)
returns a histogram of the dataset, based on the extent and scaletype of the data.

Parameters:
ds -
binCount - number of bins
Returns:

outerProduct

public static QDataSet outerProduct(QDataSet ds1,
                                    QDataSet ds2)
returns outerProduct of two rank 1 datasets, a rank 2 dataset with elements R[i,j]= ds1[i] * ds2[j].

Parameters:
ds1 -
ds2 -
Returns:

floor

public static QDataSet floor(QDataSet ds1)

ceil

public static QDataSet ceil(QDataSet ds1)

signum

public static QDataSet signum(QDataSet ds1)
Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero.

Parameters:
ds1 -
Returns:
See Also:
copysign

copysign

public static QDataSet copysign(QDataSet magnitude,
                                QDataSet sign)
Returns the first floating-point argument with the sign of the second floating-point argument.

Parameters:
magnitude -
sign -
Returns:
See Also:
signum

findex

public static QDataSet findex(QDataSet uu,
                              QDataSet vv)
returns the floating point index of each element of vv within the monotonically increasing dataset uu. The result dataset will have the same geometry as vv. The result will be negative when the element of vv is below the smallest element of uu. The result will be greater than or equal to the length of uu minus one when it is greater than all elements.

Parameters:
uu - rank 1 monotonically increasing dataset.
vv - rank N dataset with values in the same physical dimension as uu.
Returns:
rank N dataset with the same geometry as vv.

interpolate

public static QDataSet interpolate(QDataSet vv,
                                   QDataSet findex)
interpolate values from rank 1 dataset vv using fractional indeces in rank N findex.

Parameters:
vv - rank 1 dataset.
findex - rank N dataset of fractional indeces.
Returns:

interpolate

public static QDataSet interpolate(QDataSet vv,
                                   QDataSet findex0,
                                   QDataSet findex1)
interpolate values from rank 1 dataset vv using fractional indeces in rank N findex, using bilinear interpolation.

Parameters:
vv - rank 2 dataset.
findex0 - rank N dataset of fractional indeces for the zeroth index.
findex1 - rank N dataset of fractional indeces for the first index.
Returns:
rank N dataset

smooth

public static QDataSet smooth(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

diff

public static QDataSet diff(QDataSet ds)
return array that is the differences between each successive pair in the dataset. Result[i]= ds[i+1]-ds[i], so that for an array with N elements, an array with N-1 elements is returned.

Parameters:
ds - a rank 1 dataset with N elements.
Returns:
a rank 1 dataset with N-1 elements.

labels

public static QDataSet labels(java.lang.String[] labels,
                              java.lang.String context)
create a labels dataset for tagging rows of a dataset. Example: dep1= labels( ["X","Y","Z"], "GSM" )

Parameters:
labels -
context -
Returns:
rank 1 QDataSet

labels

public static QDataSet labels(java.lang.String[] labels)
create a labels dataset for tagging rows of a dataset. Example: dep1= labels( ["X","Y","Z"], "GSM" )

Parameters:
labels -
Returns:
rank 1 QDataSet

reform

public static QDataSet reform(QDataSet ds)
Reshape the dataset to remove the first dimension with length 1, reducing its rank by 1. Dependencies are also preserved.

Parameters:
ds -
Returns:

reform

public static QDataSet reform(QDataSet ds,
                              int[] qube)

join

public static QDataSet join(QDataSet ds1,
                            QDataSet ds2)
Join two rank N datasets to make a rank N+1 dataset, with the first dimension having two elements. This is the anti-slice operator. Soon: Alternatively, if one dataset is rank N+1 and the other is rank N, then the rank N dataset is added to the rank N+1 dataset. This is underimplemented right now, and can only join two rank N datasets or if the first dataset is the result of a join.

Parameters:
ds1 - rank N dataset, or null
ds2 - rank N dataset
Returns:
rank N+1 dataset
See Also:
slice, concatenate

transpose

public static QDataSet transpose(QDataSet ds)