## dataGroupDifference

dataGroupDifference( QDataSet tE, QDataSet tB ) → QDataSet

return the points in the first dataset (tE) which are not found in the second dataset(tB). This is done in N log N time. ChatGPT suggests name "dataOnlyInA", which might be a more clear name.

### Parameters

tE - rank 1 dataset
tB - rank 1 dataset

### Returns:

the set of values found in the first but not the second.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dataIntersection

dataIntersection( int[] itE, int[] itB ) → int[]

return the values which occur in both rank 1 datasets. Each dataset is sorted.

### Parameters

itE - a bunch of values.
itB - a bunch of values.

### Returns:

the set of values found in both.

### See Also:

eventsConjunction(QDataSet, QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dataIntersection

dataIntersection( QDataSet tE, QDataSet tB ) → QDataSet

return the values which occur in both rank 1 datasets. Each dataset is sorted.

### Parameters

tE - a bunch of values.
tB - a bunch of values.

### Returns:

the set of values found in both.

### See Also:

eventsConjunction(QDataSet, QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dataset

dataset( Object arg0 ) → QDataSet

coerce Java objects like arrays Lists and scalars into a QDataSet. This is introduced to mirror the useful Jython dataset command. This is a nasty business that is surely going to cause all sorts of problems, so we should do it all in one place. See http://jfaden.net/jenkins/job/autoplot-test029/ This supports:

- int, float, double, etc to Rank 0 datasets
- List<Number> to Rank 1 datasets.
- Java arrays of Number to Rank 1-4 qubes datasets
- Strings to rank 0 datasets with units ("5 s" or "2014-01-01T00:00")
- Datums to rank 0 datasets
- DatumRanges to rank 1 bins
- DatumVector to rank 1 datasets.

### Parameters

arg0 - null,QDataSet,Number,Datum,DatumRange,String,List,or array.

### Returns:

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

## dataset

dataset( Object arg0, Units u ) → QDataSet

coerce Java objects like arrays Lists and scalars into a QDataSet. This is introduced to mirror the useful Jython dataset command. This is a nasty business that is surely going to cause all sorts of problems, so we should do it all in one place. See https://cottagesystems.com/jenkins/job/autoplot-test029/ This supports:

- int, float, double, etc to Rank 0 datasets
- List<Number> to Rank 1 datasets.
- Java arrays of Number to Rank 1-4 qubes datasets
- Strings to rank 0 datasets with units ("5 s" or "2014-01-01T00:00")
- Datums to rank 0 datasets
- DatumRanges to rank 1 bins

### Parameters

arg0 - null,QDataSet,Number,Datum,DatumRange,String,List,or array.
u - units providing context

### Returns:

QDataSet

### See Also:

JythonOps#dataset(PyObject, org.das2.datum.Units)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## datum

datum( Object arg0 ) → Datum

coerce Java objects like numbers and strings into a Datum. This is introduced to mirror the useful Jython dataset command. This is a nasty business that is surely going to cause all sorts of problems, so we should do it all in one place. See https://cottagesystems.com/jenkins/job/autoplot-test029/ This supports:

- int, float, double, etc to Rank 0 datasets
- Strings to rank 0 datasets with units ("5 s" or "2014-01-01T00:00")
- rank 0 datasets

### Parameters

arg0 - null,QDataSet,Number,Datum, or String.

### Returns:

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

## datumRange

datumRange( Object arg0 ) → DatumRange

coerce Java objects like arrays and strings into a DatumRange. This is introduced to mirror the useful Jython dataset command. This is a nasty business that is surely going to cause all sorts of problems, so we should do it all in one place. See https://cottagesystems.com/jenkins/job/autoplot-test029/ This supports:

- 2-element rank 1 QDataSet
- Strings like ("5 to 15 s" or "2014-01-01")
- 2-element arrays and lists

### Parameters

arg0 - null, QDataSet, String, array or List.

### Returns:

DatumRange

### See Also:

boundsDataset(java.lang.String)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dblarr

dblarr( int len0 ) → QDataSet

create a rank 1 dataset filled with zeros, stored in 8-byte doubles.

### Parameters

len0 - the length of the zeroth dimension.

### Returns:

rank 1 dataset filled with zeros.

### See Also:

zeros(int)
fltarr(int)
bytarr(int)
shortarr(int)
intarr(int)
lonarr(int)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dblarr

dblarr( int len0, int len1 ) → QDataSet

create a rank 2 dataset filled with zeros, stored in 8-byte doubles.

### Parameters

len0 - the length of the zeroth dimension.
len1 - the length of the first dimension.

### Returns:

rank 2 dataset filled with zeros.

### See Also:

zeros(int)
fltarr(int)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dblarr

dblarr( int len0, int len1, int len2 ) → QDataSet

create a rank 3 dataset filled with zeros, stored in 8-byte doubles.

### Parameters

len0 - the length of the zeroth dimension.
len1 - the length of the first dimension.
len2 - the length of the second dimension.

### Returns:

rank 3 dataset filled with zeros.

### See Also:

zeros(int)
fltarr(int)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## decimate

decimate( QDataSet ds ) → QDataSet

reduce the size of the data by keeping every 10th measurement.

### Parameters

ds - a qube dataset.

### Returns:

a decimated qube dataset.

### See Also:

decimate(QDataSet, int)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## decimate

decimate( QDataSet ds, int m ) → QDataSet

reduce the size of the data by keeping every nth measurement (subsample), starting at the 0th measurement.

### Parameters

ds - rank 1 or more dataset.
m - the decimation factor, e.g. 2 is every other measurement.

### Returns:

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

## decimate

decimate( QDataSet ds, int m, int n ) → QDataSet

reduce the size of the data by keeping every nth measurement (subsample).

### Parameters

ds - rank 2 or more dataset.
m - the decimation factor for the zeroth index, e.g. 2 is every other measurement.
n - the decimation factor for the first index, e.g. 2 is every other measurement.

### Returns:

new dataset which is ds.length()/m by ds.length(0)/n.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dependsOn

dependsOn( QDataSet ds, int dim, QDataSet dep ) → org.das2.qds.MutablePropertyDataSet

declare that the dataset is a dependent parameter of an independent parameter. This isolates the QDataSet semantics, and verifies correctness. See also link(x,y).

### Parameters

ds - the dataset
dim - dimension to declare dependence: 0,1,2.
dep - the independent dataset.

### Returns:

the dataset, which may be a copy if the data was not mutable.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## detrend

detrend( QDataSet yy, int size ) → QDataSet

remove D/C and low-frequency components from the data by subtracting out the smoothed data with a boxcar of the given size. Points on the end are zero.

### Parameters

yy - rank 1 dataset
size - size of the boxcar

### Returns:

dataset
[search for examples] [view on GitHub] [view on old javadoc] [view source]
detrend( Object yy, int size ) → QDataSet [view source]

## detrend1

detrend1( QDataSet yy, int size ) → QDataSet

remove D/C and low-frequency components from the data by subtracting out the smoothed data with a boxcar of the given size, along each record. Points on the end are zero.

### Parameters

yy - rank 2 dataset
size - size of the boxcar

### Returns:

dataset

### See Also:

smooth1(QDataSet, int)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## diff

diff( QDataSet ds ) → QDataSet

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. When the data has a DEPEND_0, the result will have a DEPEND_0 which contains the average of the corresponding points.

### Parameters

ds - a rank 1 dataset with N elements.

### Returns:

a rank 1 dataset with N-1 elements.

### See Also:

accum(QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]
diff( Object ds ) → QDataSet [view source]

## dimensionCount

dimensionCount( QDataSet dss ) → int

returns the number of physical dimensions of a dataset.

- JOIN, BINS do not increase dataset dimensionality.
- DEPEND increases dimensionality by dimensionality of DEPEND ds.
- BUNDLE increases dimensionality by N, where N is the number of bundled datasets.

Note this includes implicit dimensions taken by the primary dataset:

- Z(time,freq)→3
- rand(20,20)→3
- B_gsm(20,[X,Y,Z])→4

### Parameters

dss - the dataset

### Returns:

the number of dimensions occupied by the data.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dimensionCount

dimensionCount( Object dss ) → int

returns the number of physical dimensions of the object when interpreted as a dataset.

### Parameters

dss - the object that can be coerced into a dataset.

### Returns:

the number of dimensions occupied by the data.

### See Also:

dataset(java.lang.Object)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dindgen

dindgen( int len0 ) → QDataSet

returns rank 1 dataset with values [0.,1.,2.,...]

### Parameters

len0 - an int

### Returns:

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

## dindgen

dindgen( int len0, int len1 ) → QDataSet

returns rank 2 dataset with values increasing [ [0.,1.,2.], [ 3.,4.,5.] ]

### Parameters

len0 - an int
len1 - an int

### Returns:

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

## dindgen

dindgen( int len0, int len1, int len2 ) → QDataSet

returns rank 3 dataset with values increasing

### Parameters

len0 - an int
len1 - an int
len2 - an int

### Returns:

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

## dindgen

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

returns rank 4 dataset with values increasing

### Parameters

len0 - an int
len1 - an int
len2 - an int
len3 - an int

### Returns:

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

## distance

distance( int len0, double c0, double r0 ) → QDataSet

return a table of distances d[len0] to the indices c0; in units of r0. This is motivated by a need for more interesting datasets for testing.

### Parameters

len0 - the length of the dataset
c0 - the center point 0
r0 - the units to normalize in the 0 direction

### Returns:

rank 2 table
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## distance

distance( int len0, int len1, double c0, double c1, double r0, double r1 ) → QDataSet

return a table of distances d[len0,len1] to the indices c0,c1; in units of r0, r1. This is motivated by a need for more interesting datasets for testing.

### Parameters

len0 - the length of the dataset
len1 - the length of each row of the dataset
c0 - the center point 0
c1 - the center point 1
r0 - the units to normalize in the 0 direction
r1 - the units to normalize in the 1 direction

### Returns:

rank 2 table
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## div

div( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise div of two datasets with compatible geometry.

### Parameters

ds1 - a QDataSet
ds2 - a QDataSet

### Returns:

a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]
div( Object ds1, Object ds2 ) → QDataSet [view source]

## divide

divide( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise divide of two datasets with compatible geometry. Either ds1 or ds2 should be dimensionless, or the units be convertible. TODO: units improvements.

### Parameters

ds1 - the numerator
ds2 - the divisor

### Returns:

the ds1/ds2
[search for examples] [view on GitHub] [view on old javadoc] [view source]
divide( Object ds1, Object ds2 ) → QDataSet [view source]

## divp

divp( QDataSet ds1, QDataSet ds2 ) → QDataSet

This div goes with modp, where -18 divp 10 = -2 and -18 modp 10 = 8. the div operator always goes towards zero, but divp always goes to the more negative number so the remainder is positive.

### Parameters

ds1 - a QDataSet
ds2 - a QDataSet

### Returns:

a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]
divp( Object ds1, Object ds2 ) → QDataSet [view source]