## where

where( QDataSet ds ) → QDataSet

returns a dataset containing the indeces of where the dataset is non-zero. For a rank 1 dataset, returns a rank 1 dataset with indeces for the values. For a higher rank dataset, returns a rank 2 qube dataset with ds.rank() elements in the first dimension. Note when the dataset is all zeros (false), the result is a zero-length array, as opposed to IDL which would return a -1 scalar. Note fill values are not included in the list, so it is not necessary that where(A).length + where(not A).length != where( A.or(not(A) ).length Note this is different from the SciPy "where" and similar to Matlab "find."

### Parameters

ds - of any rank M, M>0.

### Returns:

a rank 1 or rank 2 dataset with N by M elements, where N is the number of non-zero elements found.

### See Also:

putValues(QDataSet, QDataSet, QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]
where( Object ds ) → QDataSet [view source]

## whereSequence

whereSequence( QDataSet ds, QDataSet seq ) → QDataSet

return a list of indeces, similar to the where result.

### Parameters

ds - rank 1 dataset of length N
seq - rank 1 dataset, with length much less than N.

### Returns:

rank 1 list of indeces.

### See Also:

https://github.com/autoplot/dev/blob/master/demos/2021/20210115/whereSequence.jy
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## windowFunction

windowFunction( org.das2.qds.ops.Ops.FFTFilterType filt, int len ) → QDataSet

return a dataset for the given filter type. The result will be rank 1 and length len.

### Parameters

filt - the type of the window.
len - the length of the window.

### Returns:

rank 1 QDataSet with length len.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## within

within( QDataSet ds, QDataSet bounds ) → QDataSet

return non-zero where the data in ds are within the bounds. In Jython,

>     print within( [0,1,2,3,4], '2 to 4' ) --> [ 0,0,1,1,0 ]
>     print within( ttag, 'orbit:rbspa-pp:172' )

Note, before March 2, 2015, this would incorrectly return the where of the result.

### Parameters

ds - rank N dataset where N > 0
bounds - a rank 1 bounding box.

### Returns:

rank N dataset containing non-zero where the condition is true.

### See Also:

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

## within

within( Object ds, Object bounds ) → QDataSet

return non-zero where the data in ds are within the bounds. In Jython,

>     print within( [0,1,2,3,4], '2 to 4' ) --> [ 0,0,1,1,0 ]
>     print within( ttag, 'orbit:rbspa-pp:172' )

Note, before March 2, 2015, this would incorrectly return the where of the result.

### Parameters

ds - object which can be converted to rank N dataset where N > 0
bounds - a rank 1 bounding box, DatumRange, or two-element array.

### Returns:

rank N dataset containing non-zero where the condition is true.

### See Also:

without(QDataSet, QDataSet)
where(java.lang.Object) where, which is often used with this.
binsWithin(QDataSet, QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## without

without( QDataSet ds, QDataSet bounds ) → QDataSet

return non-zero where the data in ds are outside of the bounds. In Jython,

>     print without( [0,1,2,3,4], '2 to 4' ) --> [ 1,1,0,0,1 ]
>     print without( ttag, 'orbit:rbspa-pp:172' )

Note if bounds contain fill, then everything is fill.

### Parameters

ds - rank N dataset where N > 0
bounds - a rank 1 bounding box.

### Returns:

rank N dataset containing non-zero where the condition is true.

### See Also:

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

## without

without( Object ds, Object bounds ) → QDataSet

return non-zero where the data in ds are outside of the bounds. In Jython,

>     print without( [0,1,2,3,4], '2 to 4' ) --> [ 1,1,0,0,1 ]
>     print without( ttag, 'orbit:rbspa-pp:172' )

Note if bounds contain fill, then everything is fill.

### Parameters

ds - rank N dataset where N > 0
bounds - a rank 1 bounding box.

### Returns:

rank N dataset containing non-zero where the condition is true.

### See Also:

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