## where

where( QDataSet ds ) → QDataSet

returns a dataset containing the indices of where the dataset is non-zero. For a rank 1 dataset, returns a rank 1 dataset with indices 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]

## whereR1

whereR1( QDataSet ds ) → QDataSet

returns a dataset containing the indices of where the dataset is non-zero. This is used when the code using this assumes a rank 1 result.

### Parameters

ds - a rank 1 QDataSet

### Returns:

rank 1 array of index where the data is valid and non-zero.

### See Also:

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

## whereSequence

whereSequence( QDataSet ds, QDataSet seq ) → QDataSet

return a list of indices, 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 indices.

### 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, such as FFTFilterType.Hann or TenPercentEdgeCosine.TenPercentEdgeCosine
len - the length of the window.

### Returns:

rank 1 QDataSet with length len.

### See Also:

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

## windowFunction

windowFunction( String type, int len ) → QDataSet

return a dataset for the given filter type, added to support use in Jython. The result will be rank 1 and length len.

### Parameters

type - the type of the window, one of Hanning, Hann, TenPercentEdgeCosine, Unity or Boxcar.
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' )

### Parameters

ds - rank N dataset where N > 0
bounds - a rank 1 bounding box, or rank 2 array of bounding boxes, or rank 2 events list

### Returns:

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

### See Also:

without(QDataSet, QDataSet)
binsWithin(QDataSet, QDataSet)
withinSet(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)
binsWithin(QDataSet, QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## withinSet

withinSet( QDataSet ds, QDataSet set ) → QDataSet

returns 1 where the dataset contains elements within the set, 0 where elements are not within the set. Note this cannot be used to check for fill data.

### Parameters

ds - a dataset
set - a dataset, typically rank 1, of values.

### Returns:

1 where the dataset contains elements within the set, 0 otherwise.

### See Also:

not(QDataSet)
within(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]