rand

Deprecated: use randu instead rand( int len0 ) → QDataSet
rand( int len0, int len1 ) → QDataSet
rand( int len0, int len1, int len2 ) → QDataSet

randn

randn( ) → QDataSet

return a rank 0 dataset of random numbers of a Gaussian (normal) distribution.

Returns:

a rank 0 dataset of random numbers of a Gaussian (normal) distribution.

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

randn( int len0 ) → QDataSet
randn( int len0, int len1 ) → QDataSet
randn( int len0, int len1, int len2 ) → QDataSet
randn( int len0, int len1, int len2, int len3 ) → QDataSet

randomSeed

randomSeed( ) → long

restart the random sequence used by randu and randn. Note if there if there are multiple threads using random functions, this becomes unpredictable.

Returns:

the seed is returned.

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

randomSeed( long seed ) → long

randomn

randomn( long seed ) → QDataSet

returns a rank 0 dataset of random numbers of a Gaussian (normal) distribution. System.currentTimeMillis() may be used for the seed. Note this is unlike the IDL randomn function because the seed is not modified. (Any long parameter in Jython and Java is read-only.) System.currentTimeMillis() may be used for the seed.

Parameters

seed - basis for the random number (which will not be modified).

Returns:

rank 0 dataset

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

randomn( long seed, int len0 ) → QDataSet
randomn( long seed, int len0, int len1 ) → QDataSet
randomn( long seed, int len0, int len1, int len2 ) → QDataSet
randomn( long seed, int len0, int len1, int len2, int len3 ) → QDataSet

randomu

randomu( long seed ) → QDataSet

returns a rank 0 dataset of random numbers of a uniform distribution. System.currentTimeMillis() may be used for the seed. Note this is unlike the IDL randomn function because the seed is not modified. (Any long parameter in Jython and Java is read-only.)

Parameters

seed - basis for the random number (which will not be modified).

Returns:

a rank 0 dataset of random uniform numbers from 0 to 1 but not including 1.

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

randomu( long seed, int len0 ) → QDataSet
randomu( long seed, int len0, int len1 ) → QDataSet
randomu( long seed, int len0, int len1, int len2 ) → QDataSet
randomu( long seed, int len0, int len1, int len2, int len3 ) → QDataSet

randu

randu( ) → QDataSet

returns a rank 0 dataset of random uniform numbers from 0 to 1 but not including 1.

Returns:

a rank 0 dataset of random uniform numbers from 0 to 1 but not including 1.

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

randu( int len0 ) → QDataSet
randu( int len0, int len1 ) → QDataSet
randu( int len0, int len1, int len2 ) → QDataSet
randu( int len0, int len1, int len2, int len3 ) → QDataSet

rebundle

rebundle( QDataSet bundle1, String[] names ) → QDataSet

unbundle the names from the bundle, and rebundle them in the order specified.

Parameters

bundle1 - a bundle of datasets
names - the bundled dataset names

Returns:

the new bundle

See Also:

unbundle(QDataSet, java.lang.String)


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

rebundle( QDataSet bundle1, int[] ii ) → QDataSet

reduceBins

reduceBins( QDataSet dep1 ) → QDataSet

reduce each bin to its center. If the spacing is log, then geometric centers are used.

Parameters

dep1 - rank 2 [N,2] bins dataset, where bins are min,max boundaries.

Returns:

rank 1 N element dataset

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


reduceMax

reduceMax( QDataSet ds, int dim ) → QDataSet

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:

rank N-1 dataset.

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

reduceMax( QDataSet ds, int dim, ProgressMonitor mon ) → QDataSet

reduceMean

reduceMean( QDataSet ds, int dim ) → QDataSet

reduce the dataset's rank by reporting the mean of all the elements along a dimension. Only QUBEs are supported presently. Note this does not contain code that would remove large offsets from zero when making the average, so the number of points is limited.

Parameters

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

Returns:

rank N-1 qube dataset.

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

reduceMean( QDataSet ds, int dim, ProgressMonitor mon ) → QDataSet

reduceMedian

reduceMedian( QDataSet ds, int dim, ProgressMonitor mon ) → QDataSet

reduce the dataset's rank by reporting the median of all the elements along a dimension. Only QUBEs are supported presently. Note the weights reported are the totals of the data going in to each median, typically the number of measurements compared (when all weights are 0 or 1).

Parameters

ds - rank N qube dataset.
dim - zero-based index number.
mon - progress monitor.

Returns:

rank N-1 qube dataset

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


reduceMin

reduceMin( QDataSet ds, int dim ) → QDataSet

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:

rank N-1 dataset.

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

reduceMin( QDataSet ds, int dim, ProgressMonitor mon ) → QDataSet

reduceSum

reduceSum( QDataSet ds, int dim ) → QDataSet

reduce the dataset's rank by reporting the sum of all the valid elements along a dimension. The property "WEIGHTS" will contain the sum of the weights. Only QUBEs are supported presently. This is like the function "total," but skips invalid values.

Parameters

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

Returns:

rank N-1 dataset.

See Also:

total(QDataSet, int)


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


reform

reform( QDataSet ds ) → QDataSet

Reshape the dataset to remove the first dimension with length 1, reducing its rank by 1. Dependencies are also preserved. If no indices are found, then the dataset is returned.

Parameters

ds - rank N dataset

Returns:

the dataset, or rank N-1 dataset with the first 1-element dimension removed.

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

reform( QDataSet ds, int nrec, int[] qube ) → QDataSet
reform( QDataSet ds, int[] qube ) → QDataSet
reform( Object ds, int[] qube ) → QDataSet

removeFill

removeFill( QDataSet ds ) → org.das2.qds.WritableDataSet

remove the fill values from the rank 1 dataset, returning a smaller dataset. This was introduced to support the mash-up dialog.

Parameters

ds - the dataset, with VALID_MIN, VALID_MAX, or FILL_VALUE indicating the invalid data points.

Returns:

dataset with the values removed.

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


removeIndeces

removeIndeces( QDataSet vv, QDataSet indices ) → QDataSet

remove the data at the indices from the rank 1 dataset. This can be used for example like so:

 
 ds= ripples(20)
 ds= removeIndeces( ds, where( valid(ds).eq(0) ) )
 print ds.length()
 
 

Parameters

vv - a rank 1 dataset
indices - the indices to remove.

Returns:

a dataset with the values removed.

See Also:

https://github.com/autoplot/dev/blob/master/rfe/20190208/demoRemoveIndeces.jy
removeValues(QDataSet, QDataSet) which inserts fill.
where(QDataSet)


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


removeValues

removeValues( QDataSet ds, QDataSet indices ) → org.das2.qds.WritableDataSet

put fill data for these indices

Parameters

ds - the rank 1 or greater dataset
indices - rank 1 indices when ds is rank 1, or rank 2 [:,m] indices for a rank m dataset.

Returns:

the dataset with the data at the indices made invalid.

See Also:

putValues(QDataSet, QDataSet, QDataSet)
where(QDataSet)
removeIndeces(QDataSet, QDataSet) which copies the data to remove the indices.


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

removeValues( Object ds, Object indices ) → org.das2.qds.WritableDataSet

removeValuesGreaterThan

removeValuesGreaterThan( QDataSet ds, QDataSet v ) → org.das2.qds.WritableDataSet

remove values in the dataset which are greater than the value. This is a convenient method for the common case where we want to filter data by values within the data, introduced to support the data mash up dialog.

Parameters

ds - rank N dataset
v - the value, a rank 0 scalar or dataset with compatible geometry

Returns:

the dataset with these

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

removeValuesGreaterThan( Object ds, Object v ) → org.das2.qds.WritableDataSet

removeValuesLessThan

removeValuesLessThan( QDataSet ds, QDataSet v ) → org.das2.qds.WritableDataSet

remove values in the dataset which are less than the value. This is a convenient method for the common case where we want to filter data by values within the data, introduced to support the data mash up dialog. Note that this inserts fill where data is to be removed.

Parameters

ds - rank N dataset
v - the value, a rank 0 scalar or dataset with compatible geometry

Returns:

the dataset with these

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

removeValuesLessThan( Object ds, Object v ) → org.das2.qds.WritableDataSet

replicate

replicate( short val, int len0 ) → org.das2.qds.WritableDataSet

returns rank 1 dataset with value

Parameters

val - fill the dataset with this value.
len0 - an int

Returns:

an org.das2.qds.WritableDataSet

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

replicate( short val, int len0, int len1 ) → org.das2.qds.WritableDataSet
replicate( short val, int len0, int len1, int len2 ) → org.das2.qds.WritableDataSet
replicate( int val, int len0 ) → org.das2.qds.WritableDataSet
replicate( int val, int len0, int len1 ) → org.das2.qds.WritableDataSet
replicate( int val, int len0, int len1, int len2 ) → org.das2.qds.WritableDataSet
replicate( long val, int len0 ) → org.das2.qds.WritableDataSet
replicate( long val, int len0, int len1 ) → org.das2.qds.WritableDataSet
replicate( long val, int len0, int len1, int len2 ) → org.das2.qds.WritableDataSet
replicate( double val, int len0 ) → org.das2.qds.WritableDataSet
replicate( double val, int len0, int len1 ) → org.das2.qds.WritableDataSet
replicate( double val, int len0, int len1, int len2 ) → org.das2.qds.WritableDataSet
replicate( double val, int len0, int len1, int len2, int len3 ) → org.das2.qds.WritableDataSet
replicate( float val, int len0 ) → org.das2.qds.WritableDataSet
replicate( float val, int len0, int len1 ) → org.das2.qds.WritableDataSet
replicate( float val, int len0, int len1, int len2 ) → org.das2.qds.WritableDataSet
replicate( QDataSet val, int len0 ) → org.das2.qds.MutablePropertyDataSet
replicate( QDataSet val, int len0, int len1 ) → org.das2.qds.MutablePropertyDataSet

rescale

rescale( QDataSet data, QDataSet min, QDataSet max ) → QDataSet

calculate the range of data, then rescale it so that the smallest values becomes min and the largest values becomes max.

Parameters

data - rank N dataset
min - rank 0 min
max - rank 0 max

Returns:

rescaled data.

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


rescaleRange

rescaleRange( QDataSet dr, double min, double max ) → QDataSet

returns rank 1 QDataSet range relative to range "dr", where 0. is the minimum, and 1. is the maximum. For example rescaleRange(ds,1,2) is scanNext, rescaleRange(ds,0.5,1.5) is zoomOut. This is similar to the DatumRange rescale functions.

Parameters

dr - a QDataSet with bins and with nonzero width.
min - the new min normalized with respect to this range. 0. is this range's min, 1 is this range's max, -1 is min-width.
max - the new max normalized with respect to this range. 0. is this range's min, 1 is this range's max, -1 is min-width.

Returns:

new rank 1 QDataSet range.

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


rescaleRangeLogLin

rescaleRangeLogLin( QDataSet dr, double min, double max ) → QDataSet

like rescaleRange, but look at log/lin flag.

Parameters

dr - a QDataSet
min - a double
max - a double

Returns:

two-element rank 1 QDataSet

See Also:

QDataSet#SCALE_TYPE


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


reverse

reverse( QDataSet ds ) → QDataSet

returns the reverse of the rank 1 dataset.

Parameters

ds - a QDataSet

Returns:

a QDataSet

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

reverse( Object ds ) → QDataSet

rgbColorDataset

rgbColorDataset( QDataSet red, QDataSet green, QDataSet blue ) → QDataSet

create a dataset of RGB colors. The output is int(red)*256*256 + int(green)*256 + int(blue) with the units of Units.rgbColor

Parameters

red - the red component, from 0 to 255
green - the green component, from 0 to 255
blue - the blue component, from 0 to 255

Returns:

the rgb encoded colors.

See Also:

toTimeDataSet(QDataSet, QDataSet, QDataSet, QDataSet, QDataSet, QDataSet, QDataSet)


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


ripples

ripples( int len0 ) → QDataSet

rank 1 dataset for demos and testing.

Parameters

len0 - number of elements in the first index

Returns:

rank 1 dataset for demos and testing.

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

ripples( int len0, int len1 ) → QDataSet
ripples( int len0, int len1, int len2 ) → QDataSet
ripples( int len0, int len1, int len2, int len3 ) → QDataSet

ripplesJoinSpectrogramTimeSeries

ripplesJoinSpectrogramTimeSeries( int len ) → QDataSet

return fake position data for testing result is rank 3 bundle [3,len/3,27*]

Parameters

len - the total number of records.

Returns:

an example join spectrogram time series.

See Also:

Schemes#irregularJoin()


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


ripplesPitchAngleDistribution

ripplesPitchAngleDistribution( ) → QDataSet

return an example of a QDataSet containing a pitch angle distribution. This is a rank 2 dataset with angle in radians for DEPEND_0 and radius for DEPEND_1.

Returns:

an example pitch angle distribution.

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


ripplesSpectrogramTimeSeries

ripplesSpectrogramTimeSeries( int len ) → QDataSet

return fake position data for testing result is rank 2 bundle [len,27]

Parameters

len - the number of records

Returns:

fake position data for testing

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


ripplesTimeSeries

ripplesTimeSeries( int len ) → QDataSet

return fake rank 1 data timeseries for testing

Parameters

len - number of records

Returns:

fake rank 1 data timeseries for testing

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


ripplesVectorTimeSeries

ripplesVectorTimeSeries( int len ) → QDataSet

return fake position data for testing. result is rank 2 bundle [len,3]

Parameters

len - number of records

Returns:

vector time series.

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


ripplesWaveformTimeSeries

ripplesWaveformTimeSeries( int len ) → QDataSet

return fake waveform data for testing result is rank 2 bundle [len,512]

Parameters

len - number of 512-element waveforms.

Returns:

rank 2 waveform

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


round

round( QDataSet ds1 ) → QDataSet

element-wise round function. 0.5 is round up.

Parameters

ds1 - a QDataSet

Returns:

a QDataSet

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

round( double x ) → double
round( Object x ) → QDataSet
round( QDataSet ds1, int ndigits ) → QDataSet
round( double x, int ndigits ) → double
round( Object ds1, int ndigits ) → QDataSet