org.das2.qds.SparseDataSet

DataSet for storing sparse data. This is used initially to describe bundles. This returns 0 where no data has been set. For example,

sp= SparseDataSet.createQube([2,4])
sp[2,2]= 1
print sp[0,0]


createQube

createQube( int[] qube ) → SparseDataSet

create the qube dataset with the given dimensions. This was introduced because setQube cannot be called from Jython scripts.

Parameters

qube - the index dimensions.

Returns:

SparseDataSet with the given rank and dimensions based on qube.

search for examples view on GitHub view source


createRank

createRank( int rank ) → SparseDataSet

create the dataset with the given rank. The length of any dimension is explicitly set with the setLength method or implicitly by the highest index assigned a value. Note Jython scripts are unable to call the setLength method.

Parameters

rank - number of indeces

Returns:

a dataset that is empty.

See Also:

createRankLen(int, int)
createQube(int[])


search for examples view on GitHub view source


createRankLen

createRankLen( int rank, int len0 ) → SparseDataSet

create the dataset with the given rank and initial length. This was introduced because setLength cannot be called from Jython scripts. Each record will have length(i) based on the highest index assigned.

Parameters

rank - the result's rank.
len0 - the number of records in the result.

Returns:

SparseDataSet with the given rank.

See Also:

createQube(int[])


search for examples view on GitHub view source


putValue

putValue( double d ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


rank

rank( ) → int

Returns:

int

search for examples view on GitHub view source


setLength

setLength( int length ) → void

set the length of the zeroth dimension. Other dimensions have length set implicitly by the highest value set. If this is not set explicitly, then it will be implicit as well.

Parameters

length -

Returns:

void (returns nothing)

search for examples view on GitHub view source


setQube

setQube( int[] qube ) → void

make this a qube dataset, where all the lengths are the same.

Parameters

qube -

Returns:

void (returns nothing)

search for examples view on GitHub view source


value

value( ) → double

Returns:

double

search for examples view on GitHub view source