|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.virbo.dsops.Ops
public class Ops
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 |
---|
public static double PI
public static double E
Constructor Detail |
---|
public Ops()
Method Detail |
---|
public static final DDataSet applyUnaryOp(QDataSet ds1, Ops.UnaryOp op)
ds1
- op
-
public static final QDataSet applyBinaryOp(QDataSet ds1, QDataSet ds2, Ops.BinaryOp op)
ds1
- ds2
- op
-
public static final QDataSet applyBinaryOp(QDataSet ds1, double d2, Ops.BinaryOp op)
public static QDataSet add(QDataSet ds1, QDataSet ds2)
ds1
- ds2
-
public static QDataSet subtract(QDataSet ds1, QDataSet ds2)
ds1
- ds2
-
public static QDataSet negate(QDataSet ds1)
ds1
-
public static QDataSet magnitude(QDataSet ds)
ds
- of Rank N.
public static double total(QDataSet ds)
public static QDataSet total(QDataSet ds, int dim)
ds
- rank N qube dataset.dim
- zero-based index number.normalize
- return the average instead of the total.
public static QDataSet reduceMax(QDataSet ds, int dim)
ds
- rank N qube dataset.dim
- zero-based index number.
public static QDataSet reduceMin(QDataSet ds, int dim)
ds
- rank N qube dataset.dim
- zero-based index number.
public static QDataSet reduceMean(QDataSet ds, int dim)
ds
- rank N qube dataset.dim
- zero-based index number.
public static QDataSet sqrt(QDataSet ds)
ds
-
public static QDataSet abs(QDataSet ds1)
ds1
-
public static QDataSet pow(QDataSet ds1, double pow)
ds1
- pow
-
public static QDataSet pow(QDataSet ds1, QDataSet pow)
ds1
- pow
-
public static QDataSet exp(QDataSet ds)
ds
-
public static QDataSet exp10(QDataSet ds)
ds
-
public static QDataSet log(QDataSet ds)
ds
-
public static QDataSet log10(QDataSet ds)
ds
-
public static QDataSet multiply(QDataSet ds1, QDataSet ds2)
ds
-
public static QDataSet divide(QDataSet ds1, QDataSet ds2)
ds
-
public static QDataSet mod(QDataSet ds1, QDataSet ds2)
ds
-
public static QDataSet div(QDataSet ds1, QDataSet ds2)
ds
-
public static QDataSet eq(QDataSet ds1, QDataSet ds2)
ds
-
public static QDataSet ne(QDataSet ds1, QDataSet ds2)
ds1
- ds2
-
public static QDataSet gt(QDataSet ds1, QDataSet ds2)
public static QDataSet ge(QDataSet ds1, QDataSet ds2)
public static QDataSet lt(QDataSet ds1, QDataSet ds2)
public static QDataSet le(QDataSet ds1, QDataSet ds2)
public static QDataSet or(QDataSet ds1, QDataSet ds2)
public static QDataSet and(QDataSet ds1, QDataSet ds2)
public static QDataSet not(QDataSet ds1)
public static QDataSet dindgen(int len0)
size
-
public static QDataSet dindgen(int len0, int len1)
len0
- len1
-
public static QDataSet dindgen(int len0, int len1, int len2)
len0
- len1
- len2
-
public static QDataSet findgen(int len0)
size
-
public static QDataSet findgen(int len0, int len1)
len0
- len1
-
public static QDataSet findgen(int len0, int len1, int len2)
len0
- len1
- len2
-
public static QDataSet fltarr(int len0)
len0
-
public static QDataSet fltarr(int len0, int len1)
public static QDataSet fltarr(int len0, int len1, int len2)
public static QDataSet dblarr(int len0)
len0
-
public static QDataSet dblarr(int len0, int len1)
public static QDataSet dblarr(int len0, int len1, int len2)
public static QDataSet timegen(java.lang.String baseTime, java.lang.String cadence, int len0) throws java.text.ParseException
baseTime
- e.g. "2003-02-04T00:00"cadence
- e.g. "4.3 sec" "1 day"len0
- the number of elements.
java.text.ParseException
public static QDataSet linspace(double min, double max, int len0)
min
- max
- len0
-
public static QDataSet replicate(double val, int len0)
val
- fill the dataset with this value.len0
-
public static QDataSet replicate(double val, int len0, int len1)
val
- fill the dataset with this value.len0
- len1
-
public static QDataSet replicate(double val, int len0, int len1, int len2)
val
- fill the dataset with this value.len0
- len1
- len2
-
public static QDataSet replicate(float val, int len0)
val
- fill the dataset with this value.len0
-
public static QDataSet replicate(float val, int len0, int len1)
val
- fill the dataset with this value.len0
- len1
-
public static QDataSet replicate(float val, int len0, int len1, int len2)
val
- fill the dataset with this value.len0
- len1
- len2
-
public static QDataSet zeros(int len0)
len0
-
public static QDataSet zeros(int len0, int len1)
len0
-
public static QDataSet zeros(int len0, int len1, int len2)
len0
-
public static QDataSet ones(int len0)
len0
-
public static QDataSet ones(int len0, int len1)
len0
-
public static QDataSet ones(int len0, int len1, int len2)
len0
-
public static QDataSet concatenate(QDataSet ds1, QDataSet ds2)
ds1
- ds2
-
java.lang.IllegalArgumentException
- if the two datasets don't have the same rank.public static QDataSet rand(int len0)
public static QDataSet rand(int len0, int len1)
public static QDataSet rand(int len0, int len1, int len2)
public static QDataSet randn(int len0)
public static QDataSet randn(int len0, int len1)
public static QDataSet randn(int len0, int len1, int len2)
public static QDataSet randomn(long seed, int len0)
seed
- len0
-
public static QDataSet randomn(long seed, int len0, int len1)
seed
- len0
- len1
-
public static QDataSet randomn(long seed, int len0, int len1, int len2)
seed
- len0
- len1
- len2
-
public static QDataSet sin(QDataSet ds)
ds
-
public static QDataSet asin(QDataSet ds)
ds
-
public static QDataSet cos(QDataSet ds)
ds
-
public static QDataSet acos(QDataSet ds)
ds
-
public static QDataSet tan(QDataSet ds)
ds
-
public static QDataSet atan(QDataSet ds)
ds
-
public static QDataSet atan2(QDataSet dsy, QDataSet dsx)
dsy
- dsx
-
public static QDataSet cosh(QDataSet ds)
ds
-
public static QDataSet sinh(QDataSet ds)
ds
-
public static QDataSet tanh(QDataSet ds)
ds
-
public static QDataSet expm1(QDataSet ds)
expm1(x)
+ 1 is much closer to the true
result of ex than exp(x)
.
ds
-
public static QDataSet toRadians(QDataSet ds)
public static QDataSet toDegrees(QDataSet ds)
public static QDataSet where(QDataSet ds)
ds
- of any rank M
public static QDataSet sort(QDataSet ds)
ds= randn(2000) s= sort( ds ) dsSorted= ds[s]
ds
- rank 1 dataset
public static QDataSet shuffle(QDataSet ds)
s= shuffle( ds ) dsShuffled= ds[s]
ds
- rank 1 dataset
public static QDataSet fft(QDataSet ds)
ds
- a rank 1 dataset.
public static QDataSet fftWindow(QDataSet ds, int len)
ds
- rank 1 datasetlen
- the window length
public static QDataSet extent(QDataSet ds)
ds
-
public static QDataSet histogram(QDataSet ds, double min, double max, double binSize)
ds
- min
- max
- binSize
-
public static QDataSet histogram(QDataSet ds, int binCount)
ds
- binCount
- number of bins
public static QDataSet outerProduct(QDataSet ds1, QDataSet ds2)
ds1
- ds2
-
public static QDataSet floor(QDataSet ds1)
public static QDataSet ceil(QDataSet ds1)
public static QDataSet signum(QDataSet ds1)
ds1
-
copysign
public static QDataSet copysign(QDataSet magnitude, QDataSet sign)
magnitude
- sign
-
signum
public static QDataSet findex(QDataSet uu, QDataSet vv)
uu
- rank 1 monotonically increasing dataset.vv
- rank N dataset with values in the same physical dimension as uu.
public static QDataSet interpolate(QDataSet vv, QDataSet findex)
vv
- rank 1 dataset.findex
- rank N dataset of fractional indeces.
public static QDataSet interpolate(QDataSet vv, QDataSet findex0, QDataSet findex1)
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.
public static QDataSet smooth(QDataSet ds, int size)
ds
- a rank 1 dataset of size Nsize
- the number of adjacent bins to average
public static QDataSet diff(QDataSet ds)
ds
- a rank 1 dataset with N elements.
public static QDataSet labels(java.lang.String[] labels, java.lang.String context)
labels
- context
-
public static QDataSet labels(java.lang.String[] labels)
labels
-
public static QDataSet reform(QDataSet ds)
ds
-
public static QDataSet reform(QDataSet ds, int[] qube)
public static QDataSet join(QDataSet ds1, QDataSet ds2)
ds1
- rank N dataset, or nullds2
- rank N dataset
slice
,
concatenate
public static QDataSet transpose(QDataSet ds)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |