## org.das2.qds.DDataSet

rank 0,1,2,3 or 4 dataset backed by double array (8 byte real numbers).

## version

## accumValue

Deprecated: use addValue

## accumValue

Deprecated: use addValue

## addValue

addValue( int i0, double value ) → void

add this value to the current value.

### Parameters

i0 - the index
value - the value, which is cast to this internal type.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addValue

addValue( int i0, int i1, double value ) → void

add this value to the current value.

### Parameters

i0 - the index
i1 - the index
value - the value, which is cast to this internal type.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addValue

addValue( int i0, int i1, int i2, double value ) → void

add this value to the current value.

### Parameters

i0 - the index
i1 - the index
i2 - the index
value - the value, which is cast to this internal type.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addValues

addValues( QDataSet ds, QDataSet wds ) → void

add all valid values of ds to this dataset. This does not reconcile rank, see CoerceUtil.

### Parameters

ds - a QDataSet
wds - a QDataSet

### Returns:

void (returns nothing)

### See Also:

CoerceUtil#coerce(QDataSet, QDataSet, boolean, QDataSet[])
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## capability

capability( java.lang.Class clazz ) → Object

TODO: this is untested, but is left in to demonstrate how the capability method should be implemented. Clients should use this instead of casting the class to the capability class.

### Parameters

clazz - the class, such as WritableDataSet.class

### Returns:

null or the capability if exists, such as WritableDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## copyElements

copyElements( org.das2.qds.DDataSet src, int srcpos, org.das2.qds.DDataSet dest, int destpos, int nrec ) → void

copy elements of src DDataSet into dest DDataSet, with System.arraycopy. src and dst must have the same geometry, except for dim 0. Allows for aliasing when higher dimension element count matches.

### Parameters

src - source dataset
srcpos - source dataset first dimension index.
dest - destination dataset
destpos - destination dataset first dimension index.
nrec - number of records to copy. Note this is different than the other copyElements!

### Returns:

void (returns nothing)

### See Also:

copyElements(org.das2.qds.DDataSet, int, org.das2.qds.DDataSet, int, int, boolean)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## copyElements

copyElements( org.das2.qds.DDataSet src, int srcpos, org.das2.qds.DDataSet dest, int destpos, int len, boolean checkAlias ) → void

copy elements of src DDataSet into dest DDataSet, with System.arraycopy. src and dst must have the same geometry, except for dim 0. Allows for aliasing when higher dimension element count matches.

### Parameters

src - source dataset
srcpos - source dataset first dimension index.
dest - destination dataset
destpos - destination dataset first dimension index.
len - total number of elements to copy
checkAlias - bounds for aliased write (same number of elements, different geometry.)

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## create

create( int[] qube ) → org.das2.qds.DDataSet

Makes an array from array of dimension sizes. The result will have rank qube.length().

### Parameters

qube - array specifying the rank and size of each dimension

### Returns:

the array as a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createRank0

createRank0( ) → org.das2.qds.DDataSet

create a rank 1 dataset backed by array of doubles.

### Returns:

rank 0 dataset backed by double.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createRank1

createRank1( int len0 ) → org.das2.qds.DDataSet

create a rank 1 dataset backed by array of doubles.

### Parameters

len0 - length of the dimension

### Returns:

rank 1 qube dataset of backed by array of doubles.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createRank1Bins

createRank1Bins( double min, double max, Units u ) → org.das2.qds.DDataSet

convenient method for creating DatumRanges bins datasets.

### Parameters

min - the minumum value
max - the maximum value
u - the ratiometric or time location units

### Returns:

the rank1 bins dataset
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createRank2

createRank2( int len0, int len1 ) → org.das2.qds.DDataSet

create a rank 2 qube dataset backed by array of doubles.

### Parameters

len0 - length of the dimension
len1 - length of the dimension

### Returns:

rank 2 qube dataset of backed by array of doubles.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createRank3

createRank3( int len0, int len1, int len2 ) → org.das2.qds.DDataSet

create a rank 3 qube dataset backed by array of doubles.

### Parameters

len0 - length of the dimension
len1 - length of the dimension
len2 - length of the dimension

### Returns:

rank 3 qube dataset of backed by array of doubles.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createRank4

createRank4( int len0, int len1, int len2, int len3 ) → org.das2.qds.DDataSet

create a rank 4 qube dataset backed by array of doubles.

### Parameters

len0 - length of the dimension
len1 - length of the dimension
len2 - length of the dimension
len3 - length of the dimension

### Returns:

rank 4 qube dataset of backed by array of doubles.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## putValue

putValue( double value ) → void

### Parameters

value - a double

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]
putValue( int i0, double value ) → void [view source]
putValue( int i0, int i1, double value ) → void [view source]
putValue( int i0, int i1, int i2, double value ) → void [view source]
putValue( int i0, int i1, int i2, int i3, double value ) → void [view source]

## slice

slice( int i ) → QDataSet

the slice operator is better implemented here. Presently, we use System.arraycopy to copy out the data, but this could be re-implemented along with an offset parameter so the original data can be used to back the data.

### Parameters

i - the index

### Returns:

a rank N-1 slice of the data.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## trim

trim( int start, int end ) → QDataSet

### Parameters

start - an int
end - an int

### Returns:

org.das2.qds.QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## value

value( ) → double

### Returns:

double
[search for examples] [view on GitHub] [view on old javadoc] [view source]
value( int i0 ) → double [view source]
value( int i0, int i1 ) → double [view source]
value( int i0, int i1, int i2 ) → double [view source]
value( int i0, int i1, int i2, int i3 ) → double [view source]

## wrap

wrap( double[] data, int[] qube ) → org.das2.qds.DDataSet

Wraps an array from array of dimension sizes. The result will have rank qube.length(). For rank 0, data is 1-element array.

### Parameters

data - array containing the data, with the last dimension contiguous in memory.
qube - array specifying the rank and size of each dimension

### Returns:

the array as a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## wrap

wrap( double[] back, int rank, int len0, int len1, int len2 ) → org.das2.qds.DDataSet

wrap the array to make it into a dataset. This is the same as wrap( back, qube ). The data is not copied, so be sure that no outside codes modify the data unintentionally.

### Parameters

back - the array
rank - the rank of the dataset
len0 - the length, or 1 if the index is not needed.
len1 - the length, or 1 if the index is not needed.
len2 - the length, or 1 if the index is not needed.

### Returns:

the dataset wrapping the array.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## wrap

wrap( double[] back ) → org.das2.qds.DDataSet

creates a rank1 DDataSet by wrapping an existing array.

### Parameters

back - the new backing array

### Returns:

the dataset
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## wrap

wrap( double[] back, int nx, int ny ) → org.das2.qds.DDataSet

creates a DDataSet by wrapping an existing array, aliasing it to rank 2.

### Parameters

back - the new backing array
nx - number of elements in the zeroth index
ny - number of elements in the first index

### Returns:

the dataset
[search for examples] [view on GitHub] [view on old javadoc] [view source]
wrap( double[] back, int rank, int len0, int len1, int len2, int len3 ) → org.das2.qds.DDataSet [view source]

## wrap

wrap( double[] xx, Units xunits ) → org.das2.qds.DDataSet

useful create with units.

### Parameters

xx - a double[]
xunits - an Units

### Returns:

an org.das2.qds.DDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## wrapRank2

wrapRank2( double[] back, int n1 ) → org.das2.qds.DDataSet

creates a DDataSet by wrapping an existing array, and aliasing it to rank2. Note the last index is packed closest in memory.

### Parameters

back - a double[]
n1 - the size of the second dimension.

### Returns:

an org.das2.qds.DDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## wrapRank3

wrapRank3( double[] back, int n1, int n2 ) → org.das2.qds.DDataSet

creates a DDataSet by wrapping an existing array, and aliasing it to rank2. Note the last index is packed closest in memory. The first index length is calculated from the size of the array.

### Parameters

back - a double[]
n1 - the size of the second index.
n2 - the size of the third index.

### Returns:

an org.das2.qds.DDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]