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

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.
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]

windowFunction( String type, int len ) → QDataSet

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( Object ds, Object bounds ) → QDataSet

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( Object ds, Object bounds ) → QDataSet