Skip to content
Jeremy Faden edited this page Jan 15, 2020 · 5 revisions

abs

abs( QDataSet ds1 ) → QDataSet

element-wise abs. For vectors, this returns the length of each element. Note Jython conflict needs to be resolved. Note the result of this will have dimensionless units, and see magnitude for the more abstract operator.
For ratio-type units (Stevens) like "kms", the unit is preserved.

Parameters:

ds1 - the dataset

Returns:

dataset with the same geometry

See Also:

Ops#magnitude(QDataSet) magnitude(ds), which preserves the sign.

search for examples


accum

accum( QDataSet accumDs, QDataSet ds ) → QDataSet

return an array that is the running sum of each element in the array, starting with the value accum. Result[i]= accum + total( ds[0:i+1] )

Parameters:

accumDs - the initial value of the running sum. Last value of Rank 0 or Rank 1 dataset is used, or may be null.
ds - each element is added to the running sum

Returns:

the running of each element in the array.

See Also:

diff(QDataSet)

search for examples


accum

accum( QDataSet ds ) → QDataSet

return an array that is the running sum of each element in the array, starting with the value accum. Result[i]= total( ds[0:i+1] )

Parameters:

ds - each element is added to the running sum

Returns:

the running of each element in the array.

See Also:

diff(QDataSet)

search for examples


acos

acos( QDataSet ds ) → QDataSet

element-wise arccos.

Parameters:

ds -

Returns:

QDataSet

search for examples


add

add( QDataSet ds1, QDataSet ds2 ) → QDataSet

add the two datasets which have the compatible geometry and units. For example,

{@code
ds1=timegen('2014-10-15T07:23','60s',300)
ds2=dataset('30s')
print add(ds1,ds2)
}
The units handling is quite simple, and this will soon change. Note that the Jython operator + is overloaded to this method.

Parameters:

ds1 - a rank N dataset
ds2 - a rank M dataset with compatible geometry

Returns:

the element-wise sum of the two datasets.

See Also:

addGen(QDataSet, QDataSet, java.util.Map) addGen, which shows how units are resolved.

search for examples


and

and( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise logical and function. non-zero is true, zero is false.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

See Also:

bitwiseAnd(QDataSet, QDataSet)

search for examples


append

append( QDataSet ds1, QDataSet ds2 ) → QDataSet

append two datasets that are QUBEs. DEPEND_0 and other metadata is handled as well. So for example:

ds1= findgen(10)
ds2= findgen(12)
print append(ds1,ds2)  ; dataSet[22] (dimensionless)
If both datasets are ArrayDataSets and of the same component type, then the result will have this type as well. Otherwise DDataSet is returned.

Parameters:

ds1 - null or rank N dataset
ds2 - rank N dataset with compatible geometry.

Returns:

QDataSet

search for examples


appendEvents

appendEvents( QDataSet ev1, QDataSet ev2 ) → QDataSet

provide explicit method for appending two events scheme datasets. This will probably be deprecated, and this was added at 17:30 for a particular need.

Parameters:

ev1 -
ev2 -

Returns:

QDataSet

search for examples


applyBinaryOp

applyBinaryOp( QDataSet ds1, QDataSet ds2, org.das2.qds.ops.Ops.BinaryOp op ) → MutablePropertyDataSet

apply the binary operator element-for-element of the two datasets, minding dataset geometry, fill values, etc. The two datasets are coerced to compatible geometry, if possible (e.g.Temperature[Time]+2deg), using CoerceUtil.coerce. Structural metadata such as DEPEND_0 are preserved where this is reasonable, and dimensional metadata such as UNITS are dropped.

Parameters:

ds1 - the first argument
ds2 - the second argument
op - binary operation for each pair of elements

Returns:

the result with the same geometry as the pair.

search for examples


applyIndex

applyIndex( QDataSet vv, QDataSet ds, Number fillValue ) → WritableDataSet

apply the indeces, checking for out-of-bounds values.

Parameters:

vv - values to return, a rank 1, N-element dataset.
ds - the indeces.
fillValue - the value to use when the index is out-of-bounds.

Returns:

data a dataset with the geometry of ds and the units of values.

See Also:

subset(QDataSet, QDataSet) subset, which does the same thing.
applyIndex(QDataSet, int, QDataSet)

search for examples


applyIndex

applyIndex( QDataSet ds, QDataSet r ) → WritableDataSet

apply the indeces

Parameters:

ds - values to return, a rank 1, N-element dataset.
r - the indeces.

Returns:

data a dataset with the geometry of ds and the units of values.

See Also:

subset(QDataSet, QDataSet) subset, which does the same thing.
applyIndex(QDataSet, int, QDataSet)

search for examples


applyIndex

applyIndex( QDataSet ds, int dimension, QDataSet indices ) → MutablePropertyDataSet

apply the indeces to the given dimension.

Parameters:

ds -
dimension -
indices -

Returns:

MutablePropertyDataSet

See Also:

SubsetDataSet

search for examples


applyUnaryOp

applyUnaryOp( QDataSet ds1, org.das2.qds.ops.Ops.UnaryOp op ) → MutablePropertyDataSet

apply the unary operation (such as "cos") to the dataset. DEPEND_[0-3] is propagated.

Parameters:

ds1 - the argument
op - the operation for each element.

Returns:

the result the the same geometry.

search for examples


asin

asin( QDataSet ds ) → QDataSet

element-wise arcsin.

Parameters:

ds -

Returns:

QDataSet

search for examples


atan

atan( QDataSet ds ) → QDataSet

element-wise atan.

Parameters:

ds -

Returns:

QDataSet

search for examples


atan2

atan2( QDataSet y, QDataSet x ) → QDataSet

element-wise atan2, 4-quadrant atan. Note different languages have different argument order.
Microsoft office uses atan2(x,y); IDL uses atan(y,x); Matlab uses atan2(y,x); and
NumPy uses arctan2(y,x).

Parameters:

y - the y values
x - the x values

Returns:

angles between -PI and PI

search for examples


autoHistogram

autoHistogram( QDataSet ds ) → QDataSet

AutoHistogram is a one-pass self-scaling histogram, useful in autoranging data.
The data is fed into the routine, and bins will grow as more and more data is added, to result in about 100 bins. For example, if the initial binsize is 1.0 unit, and the data extent is 0-200, then bins are combined so that the new binsize is 2.0 units and 100 bins are used.

Parameters:

ds - rank N dataset (all ranks are supported).

Returns:

rank 1 dataset

search for examples


binsWithin

binsWithin( QDataSet ds, QDataSet bounds ) → QDataSet

return non-zero where the bins of ds are within the bounds.

Parameters:

ds - rank 2 bins dataset
bounds - a rank 1 bounding box.

Returns:

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

See Also:

within(QDataSet, QDataSet)

search for examples


binsWithout

binsWithout( QDataSet ds, QDataSet bounds ) → QDataSet

return non-zero where the bins of ds are outside of the bounds.

Parameters:

ds - rank 2 bins dataset
bounds - a rank 1 bounding box.

Returns:

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

See Also:

binsWithin(QDataSet, QDataSet)

search for examples


bitwiseAnd

bitwiseAnd( QDataSet ds1, QDataSet ds2 ) → QDataSet

bitwise AND operator treats the data as (32-bit) integers, and returns the bit-wise AND.

Parameters:

ds1 -
ds2 -

Returns:

bit-wise AND.

search for examples


bitwiseOr

bitwiseOr( QDataSet ds1, QDataSet ds2 ) → QDataSet

bitwise OR operator treats the data as (32-bit) integers, and returns the bit-wise OR.

Parameters:

ds1 -
ds2 -

Returns:

bit-wise OR.

search for examples


bitwiseXor

bitwiseXor( QDataSet ds1, QDataSet ds2 ) → QDataSet

bitwise XOR (exclusive or) operator treats the data as (32-bit) integers, and returns the bit-wise XOR. Note there is no bitwise not, and this is because there are no shorts, bytes. So to implement bitwise not for a 16 bit number you would have bitwiseXor( ds, dataset(2**16-1) ).

Parameters:

ds1 -
ds2 -

Returns:

bit-wise XOR.

search for examples


buckshotInterpolate

buckshotInterpolate( QDataSet xyz, QDataSet data, QDataSet xinterp, QDataSet yinterp, QDataSet zinterp ) → QDataSet

3-D interpolation performed by tesselating the space (with 4-point tetrahedra) and doing interpolation. NOTE: this does not check units.

Parameters:

xyz - rank 2 bundle of x,y,z data.
data - rank 1 dependent data, a function of x,y,z.
xinterp - the x locations to interpolate, rank 0, 1, or 2.
yinterp - the y locations to interpolate
zinterp - the z locations to interpolate

Returns:

the interpolated data.

search for examples


buckshotInterpolate

buckshotInterpolate( QDataSet xy, QDataSet data, QDataSet xinterp, QDataSet yinterp ) → QDataSet

2-D interpolation performed by tessellating the space (with 3-point triangles) and doing interpolation. NOTE: this does not check units.

Parameters:

xy - rank 2 bundle of independent data x,y points.
data - rank 1 dependent data, a function of x,y.
xinterp - the x locations to interpolate
yinterp - the y locations to interpolate

Returns:

the interpolated data.

search for examples


bundle

bundle( QDataSet ds ) → QDataSet

bundle the dataset, making an initial bundle, adding a bundle dimension.

Parameters:

ds - a rank N dataset

Returns:

rank N+1 bundle dataset

search for examples


bundle

bundle( QDataSet ds1, QDataSet ds2 ) → QDataSet

bundle the two datasets, adding if necessary a bundle dimension. This will try to bundle on the second dimension, unlike join. This will also isolate the semantics of bundle dimensions as it's introduced. Note the first argument can be null in order to simplify loops in client code.

Parameters:

ds1 - null, rank N dataset with n records or rank N+1 bundle dataset
ds2 - rank N dataset.

Returns:

rank N+1 bundle dataset, presently with mutable properties.

See Also:

join(QDataSet, QDataSet)

search for examples


bundle

bundle( QDataSet ds1, QDataSet ds2, QDataSet ds3 ) → QDataSet

bundle three datasets, giving them a common zeroth index, typically time. unlike join. This bundles on the second dimension, unlike join. This is just like bundle(ds1,ds2), in fact this just calls bundle( bundle( ds1,ds2 ), ds3 )

Parameters:

ds1 - rank 1 (for now) dataset with n records or rank 2 bundle dataset
ds2 - rank 1 (for now) dataset with n records
ds3 - rank 1 (for now) dataset with n records

Returns:

rank 2 [n,3] bundle dataset

See Also:

join(QDataSet, QDataSet)

search for examples


bundle

bundle( QDataSet ds1, QDataSet ds2, QDataSet ds3, QDataSet ds4 ) → QDataSet

bundle four datasets, making them share their zeroth index, typically time, unlike join. This is just like bundle(ds1,ds2), in fact this just calls bundle( bundle( bundle( ds1,ds2 ), ds3 ), ds4 )

Parameters:

ds1 - rank 1 (for now) dataset with n records or rank 2 bundle dataset
ds2 - rank 1 (for now) dataset with n records
ds3 - rank 1 (for now) dataset with n records
ds4 - rank 1 (for now) dataset with n records

Returns:

rank 2 [n,4] bundle dataset

See Also:

join(QDataSet, QDataSet)

search for examples


butterworth

butterworth( QDataSet in, int order, Datum f, boolean lowp ) → QDataSet

Perform Butterworth filter for high pass or low pass.

Parameters:

in - the rank 1 waveform
order - the order of the filter (2,3,4)
f - the frequency, e.g. Units.hertz.createDatum(10)
lowp - true for low pass, false for high pass.

Returns:

the dataset in the same form.

search for examples


butterworth

butterworth( QDataSet in, int order, Datum flow, Datum fhigh, boolean pass ) → QDataSet

Perform Butterworth filter for notch or band pass or band reject.

Parameters:

in - the rank 1 waveform
order - the order of the filter (2,3,4)
flow - the lower band limit, e.g. Units.hertz.createDatum(10)
fhigh - the higher band limit, e.g. Units.hertz.createDatum(20)
pass - true for band pass, false for band reject.

Returns:

the dataset in the same form.

search for examples


bytarr

bytarr( int len0 ) → QDataSet

create a dataset filled with zeros, stored in unsigned bytes. Each element can contain numbers from 0 to 255.

Parameters:

len0 - the zeroth dimension length

Returns:

rank 1 dataset filled with zeros.

See Also:

dblarr(int)

search for examples


bytarr

bytarr( int len0, int len1 ) → QDataSet

create a rank 2 dataset filled with zeros, stored in unsigned bytes.

Parameters:

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

Returns:

rank 2 dataset filled with zeros.

search for examples


bytarr

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

create a rank 3 dataset filled with zeros, stored in unsigned bytes.

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.

search for examples


ceil

ceil( QDataSet ds1 ) → QDataSet

element-wise ceil function.

Parameters:

ds1 -

Returns:

QDataSet

search for examples


chirp

chirp( QDataSet t, Datum df0, Datum dt1, Datum df1 ) → QDataSet

scipy chirp function, used for testing.

Parameters:

t - Times at which to evaluate the waveform.
df0 - Frequency (e.g. Hz) at time t=0.
dt1 - Time at which f1 is specified.
df1 - Frequency (e.g. Hz) of the waveform at time t1.

Returns:

QDataSet

search for examples


circle

circle( QDataSet radius, QDataSet x, QDataSet y ) → QDataSet

return a dataset with X and Y forming a circle, introduced as a convenient way to indicate planet location.

Parameters:

x - the x coordinate of the circle
y - the y coordinate of the circle
radius - rank 0 dataset

Returns:

QDataSet that when plotted is a circle.

search for examples


circle

circle( double radius, double x, double y ) → QDataSet

return a dataset with X and Y forming a circle, introduced as a convenient way to indicate planet location. Note this is presently returned as Y[X], but should probably return a rank 2 dataset that is a bundle.

Parameters:

x - the x coordinate of the circle
y - the y coordinate of the circle
radius - rank 0 dataset

Returns:

QDataSet that when plotted is a circle.

search for examples


circle

circle( QDataSet radius ) → QDataSet

return a dataset with X and Y forming a circle, introduced as a convenient way to indicate planet location.

Parameters:

radius - rank 0 dataset

Returns:

QDataSet that when plotted is a circle.

search for examples


circle

circle( double dradius ) → QDataSet

return a dataset with X and Y forming a circle, introduced as a convenient way to indicate planet location.

Parameters:

dradius -

Returns:

QDataSet that when plotted is a circle.

search for examples


circle

circle( java.lang.String sradius ) → QDataSet

return a dataset with X and Y forming a circle, introduced as a convenient way to indicate planet location.

Parameters:

sradius - string parsed into rank 0 dataset

Returns:

QDataSet that when plotted is a circle.

search for examples


clearWritable

clearWritable( WritableDataSet ds ) → void

assign zeros to all the values of the dataset. The dataset must be mutable. This was used to verify Jython behavior.

Parameters:

ds -

Returns:

void

search for examples


collapse0

collapse0( QDataSet fillDs, int st, int en ) → QDataSet

this is introduced to mimic the in-line function which reduces the dimensionality by averaging over the zeroth dimension. collapse0( ds[30,20] ) → ds[20]

Parameters:

fillDs -
st - the start index
en - the non-inclusive end index

Returns:

the averaged dataset

search for examples


collapse0

collapse0( QDataSet fillDs ) → QDataSet

this is introduced to mimic the in-line function which reduces the dimensionality by averaging over the zeroth dimension. collapse0( ds[30,20] ) → ds[20]

Parameters:

fillDs -

Returns:

the averaged dataset

search for examples


collapse0R4

collapse0R4( QDataSet ds, ProgressMonitor mon ) → QDataSet

Collapse the rank 4 dataset on the zeroth index.

Parameters:

ds - rank 4 dataset
mon -

Returns:

rank 3 dataset

See Also:

org.das2.qds.OperationsProcessor#sprocess(java.lang.String, QDataSet, org.das2.util.monitor.ProgressMonitor)

search for examples


collapse1

collapse1( QDataSet ds ) → QDataSet

this is introduced to mimic the in-line function which reduces the dimensionality by averaging over the first dimension collapse1( ds[30,20] ) → ds[30]

Parameters:

ds -

Returns:

the averaged dataset

search for examples


collapse1R4

collapse1R4( QDataSet ds, ProgressMonitor mon ) → QDataSet

Collapse the rank 4 dataset on the first index.

Parameters:

ds - rank 4 dataset
mon -

Returns:

rank 3 dataset

See Also:

org.das2.qds.OperationsProcessor#sprocess(java.lang.String, QDataSet, org.das2.util.monitor.ProgressMonitor)

search for examples


collapse2

collapse2( QDataSet fillDs ) → QDataSet

this is introduced to mimic the in-line function which reduces the dimensionality by averaging over the first dimension collapse2( ds[30,20,10,5] ) → ds[30,20,5]

Parameters:

fillDs -

Returns:

the averaged dataset

search for examples


collapse2R4

collapse2R4( QDataSet ds, ProgressMonitor mon ) → QDataSet

Collapse the rank 4 dataset on the second index.

Parameters:

ds - rank 4 dataset
mon -

Returns:

rank 3 dataset

See Also:

org.das2.qds.OperationsProcessor#sprocess(java.lang.String, QDataSet, org.das2.util.monitor.ProgressMonitor)

search for examples


collapse3

collapse3( QDataSet fillDs ) → QDataSet

this is introduced to mimic the in-line function which reduces the dimensionality by averaging over the first dimension collapse3( ds[30,20,10,5] ) → ds[30,20,10]

Parameters:

fillDs -

Returns:

the averaged dataset

search for examples


collapse3R4

collapse3R4( QDataSet ds, ProgressMonitor mon ) → QDataSet

Collapse the rank 4 dataset on the third index.

Parameters:

ds - rank 4 dataset
mon -

Returns:

rank 3 dataset

See Also:

org.das2.qds.OperationsProcessor#sprocess(java.lang.String, QDataSet, org.das2.util.monitor.ProgressMonitor)

search for examples


colorFromString

colorFromString( java.lang.String sval ) → java.awt.Color

return the color encoded as one of:

  • "red" or "RED" or X11 color names like "LightPink"
  • #FF0000
  • 255,0,0 or 1.0,0,0

Parameters:

sval - the string representation

Returns:

the color

search for examples


complexConj

complexConj( QDataSet ds ) → QDataSet

return the complex conjugate of the rank 1 or rank 2 QDataSet.

Parameters:

ds - ds[2] or ds[n,2]

Returns:

ds[2] or ds[n,2]

See Also:

complexMultiply(QDataSet, QDataSet)

search for examples


complexDataset

complexDataset( QDataSet realPart, QDataSet imaginaryPart ) → QDataSet

create a complex dataset.

Parameters:

realPart - the real component.
imaginaryPart - the complex component.

Returns:

complex dataset

See Also:

org.das2.qds.examples.Schemes#rank2ComplexNumbers()

search for examples


complexMultiply

complexMultiply( QDataSet ds1, QDataSet ds2 ) → QDataSet

perform complex multiplication, where the two datasets must have the same rank and must both end with a complex dimension.

Parameters:

ds1 - ds[2] or ds[n,2] or ds[n,m,2]
ds2 - ds[2] or ds[n,2] or ds[n,m,2]

Returns:

ds[2] or ds[n,2] or ds[n,m,2]

See Also:

complexConj(QDataSet)

search for examples


concatenate

concatenate( QDataSet ds1, QDataSet ds2 ) → QDataSet

concatenates the two datasets together, appending the datasets on the zeroth dimension. The two datasets must be QUBES have similar geometry on the higher dimensions. If one of the datasets is rank 0 and the geometry of the other is rank 1, then the lower rank dataset is promoted before appending. If the first dataset is null and the second is non-null, then return the second dataset.

Parameters:

ds1 - null or a dataset of length m.
ds2 - dataset of length n to be concatenated.

Returns:

a dataset length m+n.

See Also:

merge(QDataSet, QDataSet) merge(ds1,ds2), which will interleave to preserve monotonic.
append(QDataSet, QDataSet)

search for examples


contour

contour( QDataSet tds, QDataSet vv ) → QDataSet

contour the data in rank 2 table tds at rank 0 vv. The result is a rank 2 bundle of [:,'x,y,z'] where i is the contour number. The result will have DEPEND_0 be an monotonically increasing sequence with jumps indicating new contours.

Parameters:

tds - rank 2 table
vv - rank 2 bundle

Returns:

QDataSet

search for examples


convertPropertyValue

convertPropertyValue( QDataSet context, java.lang.String name, Object value ) → java.lang.Object

convert the object into the type needed for the property.

Parameters:

context - the dataset to which we are assigning the value.
name - the property name
value - the value

Returns:

the correct value.

See Also:

org.autoplot.jythonsupport.PyQDataSet#convertPropertyValue

search for examples


convertUnitsTo

convertUnitsTo( QDataSet ds, Units u ) → QDataSet

convert the dataset to the target units

Parameters:

ds - the original dataset.
u - units of the new dataset

Returns:

a new dataset with all the same properties but with the new units.

search for examples


convertUnitsTo

convertUnitsTo( DatumRange dr, Units u ) → DatumRange

convert the datumRange to the given units, which must be convertible.

Parameters:

dr - the datum range, e.g. '5 to 50 MHz'
u - the new units. e.g. 'Hz'

Returns:

DatumRange in the new units, e.g. '5000000 to 50000000 Hz'

search for examples


convertUnitsTo

convertUnitsTo( Datum d, Units u ) → Datum

convert the datum to the given units, which must be convertible.

Parameters:

d - the datum, e.g. '5 MHz'
u - the new units, e.g. 'Hz'

Returns:

Datum in the new units, e.g. '5000000 Hz'

search for examples


copy

copy( QDataSet src ) → WritableDataSet

copy the dataset to make a new one that is writable. When a join dataset is copied, a WritableJoinDataSet is used to copy each dataset. This is a deep copy, so for example DEPEND_0 is copied as well. Note that BufferDataSets will be copied to BufferDataSets, and ArrayDataSets will be copied to ArrayDataSets.

Parameters:

src -

Returns:

a copy of src.

search for examples


copyIndexedProperties

copyIndexedProperties( QDataSet srcds, MutablePropertyDataSet mds ) → void

copy over all the indexed properties into the mutable property dataset. This was introduced to support DataSetOps.unbundle, but should probably always be used. See https://sourceforge.net/p/autoplot/bugs/1704/

Parameters:

srcds - the source dataset
mds - the destination dataset

Returns:

void

search for examples


copyProperties

copyProperties( QDataSet ds ) → java.util.Map

copies the properties, copying depend datasets as well.
TODO: This is not thorough, and this needs to be reviewed.

Parameters:

ds - the data from which the properties are extracted.

Returns:

a map of the properties.

See Also:

DataSetUtil#getProperties(QDataSet)

search for examples


copysign

copysign( QDataSet magnitude, QDataSet sign ) → QDataSet

Returns the first floating-point argument with the sign of the second floating-point argument.

Parameters:

magnitude -
sign -

Returns:

QDataSet

See Also:

signum
negate

search for examples


cos

cos( QDataSet ds ) → QDataSet

element-wise cos.

Parameters:

ds -

Returns:

QDataSet

search for examples


cosh

cosh( QDataSet ds ) → QDataSet

element-wise cosh.

Parameters:

ds -

Returns:

QDataSet

search for examples


createEvent

createEvent( java.lang.String timeRange, int rgbcolor, java.lang.String annotation ) → QDataSet

tool for creating ad-hoc events datasets.

Parameters:

timeRange - a timerange like "2010-01-01" or "2010-01-01/2010-01-10" or "2010-01-01 through 2010-01-09"
rgbcolor - and RGB color like 0xFF0000 (red), 0x00FF00 (green), or 0x0000FF (blue),
annotation - label for event, possibly including granny codes.

Returns:

a rank 2 QDataSet with startTime, stopTime, rgbColor, annotation

search for examples


createEvent

createEvent( QDataSet append, java.lang.String timeRange, int rgbcolor, java.lang.String annotation ) → QDataSet

tool for creating ad-hoc events datasets.

Parameters:

append - null or a dataset to append the result. This events dataset must have [starttime, endtime, RBG color, string] for each record.
timeRange - a timerange like "2010-01-01" or "2010-01-01/2010-01-10" or "2010-01-01 through 2010-01-09"
rgbcolor - an RGB color like 0xFF0000 (red), 0x00FF00 (green), or 0x0000FF (blue).
annotation - label for event, possibly including granny codes.

Returns:

a rank 2 QDataSet with startTime, stopTime, rgbColor, annotation

search for examples


createEvent

createEvent( QDataSet append, DatumRange dr, int rgbcolor, java.lang.String annotation ) → QDataSet

tool for creating ad-hoc events datasets. For example

Parameters:

append - null or a dataset to append the result. This events dataset must have [starttime, endtime, RBG color, string] for each record.
dr - a datum range
rgbcolor - an RGB color like 0xFF0000 (red), 0x00FF00 (green), or 0x0000FF (blue)
annotation - label for event, possibly including granny codes.

Returns:

a rank 2 QDataSet with startTime, stopTime, rgbColor, annotation

search for examples


createEvents

createEvents( QDataSet vds ) → QDataSet

make canonical rank 2 bundle dataset of min,max,color,text This was originally part of EventsRenderer, but it became clear that this was generally useful.

Parameters:

vds - dataset in a number of forms that can be converted to an events dataset.

Returns:

rank 2 QDataSet [ index; 4( time, stopTime, rgbColor, label ) ]

search for examples


createEvents

createEvents( QDataSet vds, java.awt.Color deftColor ) → QDataSet

make canonical rank 2 bundle dataset of min,max,color,text This was originally part of EventsRenderer, but it became clear that this was generally useful.

Parameters:

vds - dataset in a number of forms that can be converted to an events dataset.
deftColor - the color to use as the default color.

Returns:

rank 2 QDataSet [ index; 4( time, stopTime, rgbColor, label ) ]

search for examples


cubicRoot

cubicRoot( QDataSet coefficients ) → QDataSet

Solves each of a set of cubic equations of the form: ax^3 + bx^2 + c*x + d = 0. Takes a rank 2 dataset with each equation across the first dimension and coefficients of each equation across the second.

Parameters:

coefficients - Set of all coefficients.

Returns:

Roots of each equation. Double.NaN is returned for complex roots.

search for examples


cubicRoot

cubicRoot( double a, double b, double c, double d ) → double[]

Enter the coefficients for a cubic of the form: ax^3 + bx^2 + c*x + d = 0. Based on the method described at http://www.1728.org/cubic2.htm.

Parameters:

a - Coefficient of x^3.
b - Coefficient of x^2.
c - Coefficient of x.
d - Constant.

Returns:

Array containing 3 roots. NaN will be returned for imaginary roots.

search for examples


cumulativeMax

cumulativeMax( QDataSet ds ) → QDataSet

for each element i of ds, set the result[i] to the maximum of ds[0:(i+1)]

Parameters:

ds - rank 1 dataset

Returns:

the cumulative maximum

search for examples


cumulativeMin

cumulativeMin( QDataSet ds ) → QDataSet

for each element i of ds, set the result[i] to the minimum of ds[0:(i+1)]

Parameters:

ds - rank 1 dataset

Returns:

the cumulative minimum

search for examples


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


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.

search for examples


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:8080/hudson/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.

Returns:

QDataSet

search for examples


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 http://jfaden.net:8080/hudson/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


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 http://jfaden.net:8080/hudson/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


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 http://jfaden.net:8080/hudson/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

search for examples


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)

search for examples


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


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


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


decimate

decimate( QDataSet ds, int m ) → QDataSet

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

Parameters:

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

Returns:

QDataSet

search for examples


decimate

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

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

Parameters:

ds - rank 1 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


dependsOn

dependsOn( QDataSet ds, int dim, QDataSet dep ) → 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


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


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


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


dindgen

dindgen( int len0 ) → QDataSet

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

Parameters:

len0 -

Returns:

QDataSet

search for examples


dindgen

dindgen( int len0, int len1 ) → QDataSet

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

Parameters:

len0 -
len1 -

Returns:

QDataSet

search for examples


dindgen

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

returns rank 3 dataset with values increasing

Parameters:

len0 -
len1 -
len2 -

Returns:

QDataSet

search for examples


dindgen

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

returns rank 4 dataset with values increasing

Parameters:

len0 -
len1 -
len2 -
len3 -

Returns:

QDataSet

search for examples


distance

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

return a table of distances d[len0] to the indeces 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


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 indeces 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


div

div( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise div of two datasets with compatible geometry.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

search for examples


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


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 -
ds2 -

Returns:

QDataSet

search for examples


ellipse

ellipse( double xwidth, double ywidth ) → QDataSet

return a dataset with X and Y forming a ellipse, introduced as a convenient way to indicate planet location of any planet, according to Masafumi.

Parameters:

xwidth -
ywidth -

Returns:

QDataSet that when plotted is an ellipse.

search for examples


ensureMonotonic

ensureMonotonic( QDataSet ds ) → QDataSet

possibly sort the data where the DEPEND_0 tags are monotonically increasing. If the data is already monotonic, then nothing is done to the data.

Parameters:

ds - the dataset

Returns:

the dataset, sorted if necessary.

See Also:

DataSetUtil#isMonotonic

search for examples


ensureMonotonicAndIncreasingWithFill

ensureMonotonicAndIncreasingWithFill( QDataSet ds ) → QDataSet

Return data where the DEPEND_0 tags are monotonically increasing and non repeating. Instead of sorting the data, simply replace repeat records with a fill record.

Parameters:

ds - the dataset

Returns:

the dataset, sorted if necessary. TODO: It's surprising that monotonic doesn't imply non-repeating, and this really needs to be revisited.

See Also:

DataSetUtil#isMonotonicAndIncreasingQuick

search for examples


eq

eq( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise equality test. 1.0 is returned where the two datasets are equal. Fill is returned where either measurement is invalid.

Parameters:

ds1 - rank n dataset
ds2 - rank m dataset with compatible geometry.

Returns:

rank n or m dataset.

search for examples


equalProperties

equalProperties( java.util.Map m1, java.util.Map m2 ) → java.util.HashMap

returns the subset of two groups of properties that are equal, so these may be preserved through operations.

Parameters:

m1 - map of dataset properties, including DEPEND properties.
m2 - map of dataset properties, including DEPEND properties.

Returns:

the subset of two groups of properties that are equal

search for examples


equivalent

equivalent( QDataSet ds1, QDataSet ds2 ) → boolean

returns true iff the dataset values are equivalent. Note this may promote rank, etc. If the two datasets have enumerations, then we create datums and check .equals. This does not check TITLE, etc,
just that the units and values are equal.

Parameters:

ds1 - the first dataset
ds2 - the second dataset

Returns:

true if the dataset values are equivalent.

search for examples


eventsConjunction

eventsConjunction( QDataSet tE, QDataSet tB ) → QDataSet

return an events list of when events are found in both events lists. (This might have been better called "eventsIntersection")

Parameters:

tE - rank 2 canonical events list
tB - rank 2 canonical events list

Returns:

rank 2 canonical events list

See Also:

Schemes#eventsList()
dataIntersection(QDataSet, QDataSet)

search for examples


exp

exp( QDataSet ds ) → QDataSet

element-wise exponentiate e**x.

Parameters:

ds - the dataset

Returns:

dataset of the same geometry

search for examples


exp10

exp10( QDataSet ds ) → QDataSet

element-wise exponentiate 10**x.

Parameters:

ds -

Returns:

QDataSet

search for examples


expandToFillGaps

expandToFillGaps( QDataSet ds ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


expandToFillGaps

expandToFillGaps( QDataSet ds, double factor ) → QDataSet

Special function by the RPW Group at U. Iowa, which reassigns timetags so the small waveform packets are visible, or bursty spectrograms are more easily viewed.

Parameters:

ds -
factor - duty cycle factor (0.5=50% duty cycle)

Returns:

QDataSet

See Also:

expandWaveform(QDataSet)

search for examples


expandWaveform

expandWaveform( QDataSet ds ) → QDataSet

special function needed by the RPW Group at U. Iowa, which reassigns timetags so the small waveform packets are visible.

Parameters:

ds - rank 2 waveform

Returns:

QDataSet

See Also:

Schemes#rank2Waveform()
expandToFillGaps(QDataSet)

search for examples


expm1

expm1( QDataSet ds ) → QDataSet

Returns ex -1. Note that for values of x near 0, the exact sum of expm1(x) + 1 is much closer to the true result of ex than exp(x).

Parameters:

ds -

Returns:

QDataSet

search for examples


extent

extent( QDataSet ds ) → QDataSet

returns a two element, rank 1 dataset containing the extent of the data. Note this accounts for DELTA_PLUS, DELTA_MINUS properties. Note this accounts for BIN_PLUS, BIN_MINUS properties. The property QDataSet.SCALE_TYPE is set to lin or log. The property count is set to the number of valid measurements. TODO: this could use MONOTONIC, but it doesn't. DELTA_PLUS, DELTA_MINUS make that more difficult.

Parameters:

ds -

Returns:

two element, rank 1 "bins" dataset.

See Also:

DataSetUtil#rangeOfMonotonic(QDataSet)
AutoRangeUtil#simpleRange in Autoplot. in Autoplot.

search for examples


extent

extent( QDataSet ds, QDataSet range ) → QDataSet

returns a two element, rank 1 dataset containing the extent (min to max) of the data. Note this accounts for DELTA_PLUS, DELTA_MINUS properties.
Note this accounts for BIN_PLUS, BIN_MINUS properties. If no valid data is found then [fill,fill] is returned. The property QDataSet.SCALE_TYPE is set to lin or log. The property count is set to the number of valid measurements. 2010-10-14: add branch for monotonic datasets.

Parameters:

ds - the dataset to measure the extent
range - if non-null, return the union of this range and the extent. This must not contain fill!

Returns:

two element, rank 1 "bins" dataset.

search for examples


extent

extent( QDataSet ds, QDataSet wds, QDataSet range ) → QDataSet

returns a two element, rank 1 dataset containing the extent (min to max) of the data, allowing an external evaluation of the weightsDataSet. If no valid data is found then [fill,fill] is returned.

Parameters:

ds - the dataset to measure the extent rank 1 or rank 2 bins
wds - a weights dataset, containing zero where the data is not valid, positive non-zero otherwise. If null, then all finite data is treated as valid.
range - if non-null, return the union of this range and the extent. This must not contain fill!

Returns:

two element, rank 1 "bins" dataset.

search for examples


extent445

extent445( QDataSet ds ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


extentSimple

extentSimple( QDataSet ds, QDataSet wds, QDataSet range ) → QDataSet

like extent, but does not account for DELTA_PLUS, DELTA_MINUS, BIN_PLUS, BIN_MINUS, BIN_MIN or BIN_MAX properties. This was introduced to provide a fast way to identify constant datasets and the extent that non-constant datasets vary.

Parameters:

ds - the dataset to measure the extent rank 1 or rank 2 bins
wds - a weights dataset, containing zero where the data is not valid, positive non-zero otherwise. If null, then all finite data is treated as valid.
range - if non-null, return the union of this range and the extent. This must not contain fill!

Returns:

two element, rank 1 "bins" dataset.

See Also:

extent(QDataSet, QDataSet, QDataSet)

search for examples


extentSimple

extentSimple( QDataSet ds, QDataSet range ) → QDataSet

This is introduced to study effect of https://sourceforge.net/p/autoplot/feature-requests/445/ Do not use this in scripts!!! This is very interesting:

Ops.extent: 53ms simpleRange: 77ms study445FastRange: 4ms

Ops.extent: 76ms simpleRange: 114ms study445FastRange: 12ms

This is likely showing that DataSetIterator is slow...

Parameters:

ds - the dataset
range - null, or rank 1 bins dataset

Returns:

rank 1, two-element range, or when all data is fill result[0] will be Double.POSITIVE_INFINITY.

See Also:

extentSimple(QDataSet, QDataSet, QDataSet)

search for examples


fft

fft( QDataSet ds ) → QDataSet

Performs an FFT on the provided rank 1 dataset. A rank 2 dataset of complex numbers is returned. The data must not contain fill and must be uniformly spaced. DEPEND_0 is used to identify frequencies if available.

Parameters:

ds - a rank 1 dataset.

Returns:

a rank 2 dataset of complex numbers.

See Also:

Schemes#rank2ComplexNumbers()
Ops#ifft(QDataSet)

search for examples


fft

fft( QDataSet ds, QDataSet window, int stepFraction, ProgressMonitor mon ) → QDataSet

perform ffts on the waveform as we do with fftPower, but keep real and imaginary components.

Parameters:

ds - the waveform rank 1,2,or 3 dataset.
window - the window function, like ones(1024) or windowFunction( FFTFilterType.Hanning, 1024 ). This is used to infer window size.
stepFraction - step this fraction of the window size. 1 is no overlap, 2 is 50% overlap, 4 is 75% overlap, etc.
mon - progress monitor.

Returns:

result[ntime,nwindow,2]

search for examples


fftFilter

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

Apply windows to the data to prepare for FFT. The data is reformed into a rank 2 dataset [N,len]. The filter is applied to the data to remove noise caused by the discontinuity. This is deprecated, and windowFunction should be used so that the filter is applied to records just before each fft is performed to save space.

Parameters:

ds - rank 1, 2, or 3 data
len - size of the window.
filt - FFTFilterType.Hanning or FFTFilterType.TenPercentEdgeCosine

Returns:

data[N,len] with the window applied.

search for examples


fftPower

fftPower( QDataSet ds, int len, ProgressMonitor mon ) → QDataSet

create a power spectrum on the dataset by breaking it up and doing FFTs on each segment. A unity (or "boxcar") window is used.

data may be rank 1, rank 2, or rank 3.

Looks for DEPEND_1.USER_PROPERTIES.FFT_Translation, which should be a rank 0 or rank 1 QDataSet. If it is rank 1, then it should correspond to the DEPEND_0 dimension.

Parameters:

ds - rank 2 dataset ds(N,M) with M>len
len - the number of elements to have in each fft.
mon - a ProgressMonitor for the process

Returns:

rank 2 FFT spectrum

search for examples


fftPower

fftPower( QDataSet ds, QDataSet window, ProgressMonitor mon ) → QDataSet

perform the fft with the window, using no overlap.

Parameters:

ds - rank 1,2 or 3 waveform dataset.
window - the window
mon - a ProgressMonitor for the process

Returns:

rank 2 fft spectrum

See Also:

fftPower(QDataSet, QDataSet, int, org.das2.util.monitor.ProgressMonitor)
windowFunction(org.das2.qds.ops.Ops.FFTFilterType, int)

search for examples


fftPower

fftPower( QDataSet ds, int windowLen, int stepFraction, java.lang.String windowName, ProgressMonitor mon ) → QDataSet

fftPower that matches the filter call (|fftPower(ds,len,stepFraction,windowName)).

Parameters:

ds - rank 2 dataset ds(N,M) with M>len
windowLen - the length of the window.
stepFraction - size, expressed as a fraction of the length (1 for no slide, 2 for half steps, 4 for quarters)
windowName - name for the window, including "Hanning" "Hann" "TenPercentEdgeCosine", "Unity", "Boxcar"
mon - a ProgressMonitor for the process

Returns:

rank 2 fft spectrum

See Also:

fftPower(QDataSet, QDataSet, int, org.das2.util.monitor.ProgressMonitor)

search for examples


fftPower

fftPower( QDataSet ds, QDataSet window, int stepFraction, ProgressMonitor mon ) → QDataSet

create a power spectrum on the dataset by breaking it up and doing FFTs on each segment.

data may be rank 1, rank 2, or rank 3.

Looks for DEPEND_1.USER_PROPERTIES.FFT_Translation, which should be a rank 0 or rank 1 QDataSet. If it is rank 1, then it should correspond to the DEPEND_0 dimension. This is used to indicate that the waveform collected with respect to a carrier tone, and the result should be translated.

No normalization is done with non-unity windows. TODO: This probably should be done.
I verified this is not done, see sftp://jbf@jfaden.net/home/jbf/ct/autoplot/script/bugs/1317/testWindowFunctionNormalization.jy

Parameters:

ds - rank 2 dataset ds(N,M) with M>len, rank 3 with the same cadence, or rank 1.
window - window to apply to the data before performing FFT (Hann,Unity,etc.)
stepFraction - size, expressed as a fraction of the length (1 for no slide, 2 for half steps, 4 for quarters)
mon - a ProgressMonitor for the process

Returns:

rank 2 FFT spectrum, or rank 3 if the rank 3 input has differing cadences.

search for examples


fftPower

fftPower( QDataSet ds ) → QDataSet

returns the power spectrum of the waveform. Positive frequencies are returned for DEPEND_0, and square of the magnitude is returned for the values.

Parameters:

ds - rank 1 waveform or rank 2 array of waveforms

Returns:

rank 1 dataset, or rank 2 for rank 2 input.

search for examples


fftPowerMultiThread

fftPowerMultiThread( QDataSet ds, int len, ProgressMonitor mon ) → QDataSet

Experiment with multi-threaded FFTPower function. This breaks up the task into four independent tasks that can be run in parallel.

Parameters:

ds - rank 2 dataset ds(N,M) with M>len
len - the number of elements to have in each fft.
mon - a ProgressMonitor for the process

Returns:

rank 2 FFT spectrum

search for examples


fftWindow

fftWindow( QDataSet ds, int len ) → QDataSet

perform ffts on the rank 1 dataset to make a rank2 spectrogram.

Parameters:

ds - rank 1 dataset
len - the window length

Returns:

rank 2 dataset.

search for examples


findex

findex( QDataSet uu, QDataSet vv ) → QDataSet

returns the "floating point index" of each element of vv within the monotonically increasing dataset uu. This handy number is the index of the lower bound plus the fractional position between the two bounds. For example, findex([100,110,120],111.2) is 1.12 because it is just after the 1st element (110) and is 12% of the way from 110 to 120. The result dataset will have the same geometry as vv. The result will be negative when the element of vv is below the smallest element of uu. The result will be greater than or equal to the length of uu minus one when it is greater than all elements. When the monotonic dataset contains repeat values, the index of the first is returned.

Paul Ricchiazzi wrote this routine first for IDL as a fast replacement for the interpol routine, but it is useful in other situations as well.

Parameters:

uu - rank 1 monotonically increasing dataset, non-repeating, containing no fill values.
vv - rank N dataset with values in the same physical dimension as uu. Fill is allowed.

Returns:

rank N dataset with the same geometry as vv. It will have DEPEND_0=vv when vv is rank 1.

search for examples


findgen

findgen( int len0 ) → QDataSet

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

Parameters:

len0 -

Returns:

QDataSet

search for examples


findgen

findgen( int len0, int len1 ) → QDataSet

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

Parameters:

len0 -
len1 -

Returns:

QDataSet

search for examples


findgen

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

returns rank 3 dataset with values increasing

Parameters:

len0 -
len1 -
len2 -

Returns:

QDataSet

search for examples


findgen

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

returns rank 4 dataset with values increasing

Parameters:

len0 -
len1 -
len2 -
len3 -

Returns:

QDataSet

search for examples


finite

finite( QDataSet ds ) → QDataSet

returns 1 where the data is not NaN, Inf, etc I needed this when I was working with the RBSP polar scatter script. Note valid should be used to check for valid data, which also checks for NaN.

Parameters:

ds - qdataset of any rank.

Returns:

1 where the data is not Nan or Inf, 0 otherwise.

search for examples


flatten

flatten( QDataSet ds ) → QDataSet

flatten a rank N dataset, though currently rank 4 is not supported. The result for rank 2 is an n,3 dataset of [x,y,z], or if there are no tags, just [z]. The last index will be the dependent variable, and the first indeces will be the independent variables sorted by dimension.

Parameters:

ds - the rank N dataset (note only Rank 2 is supported for now).

Returns:

rank 2 dataset bundle

See Also:

org.das2.qds.DataSetOps#flattenRank2(QDataSet)
grid(QDataSet)
flattenWaveform(QDataSet)

search for examples


flattenWaveform

flattenWaveform( QDataSet ds ) → QDataSet

flatten a rank 2 dataset where the y depend variable is just an offset from the xtag. Note the new DEPEND_0 may have different units from ds.property(DEPEND_0).

Parameters:

ds - rank 2 waveform with tags for DEPEND_0 and offsets for DEPEND_1

Returns:

rank 1 waveform

See Also:

flatten(QDataSet)
DataSetOps#flattenWaveform(QDataSet)

search for examples


floor

floor( QDataSet ds1 ) → QDataSet

element-wise floor function.

Parameters:

ds1 -

Returns:

QDataSet

search for examples


fltarr

fltarr( int len0 ) → QDataSet

create a dataset filled with zeros, stored in 4-byte floats.

Parameters:

len0 - the zeroth dimension length

Returns:

rank 1 dataset filled with zeros.

See Also:

zeros(int)
dblarr(int)

search for examples


fltarr

fltarr( int len0, int len1 ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


fltarr

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

Parameters:

Returns:

QDataSet

search for examples


gamma

gamma( double n ) → double

return the gamma function for numbers greater than 0. This will soon work for any number where gamma has a result (Apache Math v3 is needed for this).

Parameters:

n -

Returns:

double

search for examples


gamma

gamma( Object n ) → QDataSet

return the gamma function for numbers greater than 0. This will soon work for any number where gamma has a result (Apache Math v3 is needed for this).

Parameters:

n -

Returns:

QDataSet

search for examples


ge

ge( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise function returns 1 where ds1>=ds2.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

search for examples


getProperty

getProperty( QDataSet ds, java.lang.String name ) → java.lang.Object

retrieve a property from the dataset. This was introduced for use in the Data Mash Up tool.

Parameters:

ds - the dataset
name - the property name

Returns:

the property or null (None) if the dataset doesn't have the property.

search for examples


getQubeDimsForArray

getQubeDimsForArray( Object arg0 ) → int[]

return the length of each index of a n-D array. In Java these are arrays of arrays, and no test is made to verify that the array is really a qube. This was introduced when it appeared that Python/jpype was producing arrays without the getClass method.

For example, if we have an array of 3 arrays, each having 5 elements, then [ 3,5 ] is returned.

Parameters:

arg0 - an array, or array of arrays, or array of array of arrays, etc.

Returns:

the n dimensions of each index of the array.

search for examples


greaterOf

greaterOf( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise function returns the greater of ds1 and ds2. If an element of ds1 or ds2 is fill, then the result is fill.

Parameters:

ds1 -
ds2 -

Returns:

the bigger of the two, in the units of ds1.

search for examples


grid

grid( QDataSet ds ) → QDataSet

Opposite of the flatten function, takes rank 2 bundle (x,y,z) and makes a table from it z(x,y). This presumes that the rank 1 X and Y data contain repeating elements for the rows and columns of the grid.

Parameters:

ds - rank 2 bundle of X,Y, and Z data.

Returns:

rank 2 table.

See Also:

flatten(QDataSet)

search for examples


gridIrregularY

gridIrregularY( QDataSet t, QDataSet y, QDataSet z, QDataSet ytags ) → QDataSet

This finds sweeps of Y and interpolates T->Y->Z to make a regular spectrogram T,yTags->Z[T,yTags] This function was once known as "LvT" because it was used to create a spectrogram of Flux(Time,Lshell) by interpolating along sweeps.

Parameters:

t - the rank 1 x values (often time)
y - the rank 1 y values (for example, L)
z - the rank 1 z values at each y.
ytags - the rank 1 y tags for the result.

Returns:

the rank 2 spectrogram.

search for examples


gt

gt( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise function returns 1 where ds1>ds2.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

search for examples


guessLabel

guessLabel( QDataSet ds ) → java.lang.String

get the label, using the NAME when LABEL is not available.

Parameters:

ds - the dataset

Returns:

the human-readable label.

search for examples


guessLabel

guessLabel( QDataSet ds, java.lang.String deft ) → java.lang.String

get the label, using the NAME when LABEL is not available.

Parameters:

ds - the dataset
deft - the default label to use.

Returns:

the human-readable label.

search for examples


guessName

guessName( QDataSet ds ) → java.lang.String

guess a name for the dataset, looking for NAME and then safeName(LABEL). The result will be a Java-style identifier suitable for the variable.

Parameters:

ds - the dataset

Returns:

the name or null if there is no NAME or LABEL

search for examples


guessName

guessName( QDataSet ds, java.lang.String deft ) → java.lang.String

guess a name for the dataset, looking for NAME and then safeName(LABEL). The result will be a Java-style identifier suitable for the variable.

Parameters:

ds - the dataset
deft - the default name to use.

Returns:

the name, or deft if there is no NAME or LABEL.

search for examples


hanning

hanning( QDataSet ds, int len ) → QDataSet

Apply Hanning (Hann) windows to the data to prepare for FFT. The data is reformed into a rank 2 dataset [N,len]. Hanning windows taper the ends of the interval to remove noise caused by the discontinuity. This is deprecated, and windowFunction should be used.

Parameters:

ds, - rank 1, 2, or 3 data
len -

Returns:

data[N,len] with the hanning window applied.

See Also:

windowFunction(org.das2.qds.ops.Ops.FFTFilterType, int)

search for examples


hashcodes

hashcodes( QDataSet ds ) → QDataSet

return a rank 1 hashcodes of each record the dataset, with one hashcodes value for each record. The value of hashcodes should repeat if the record repeats.

NOTE: This is under-implemented and should not be used without understanding the code.

Parameters:

ds - dataset with rank greater than 0.

Returns:

rank 1 dataset.

search for examples


hilbert

hilbert( QDataSet ds ) → QDataSet

Perform the Hilbert function on the rank 1 dataset, similar to the hilbert function in IDL and Matlab.

Parameters:

ds - rank 1 dataset of length n.

Returns:

ds[n,2], complex array

See Also:

hilbert(QDataSet)

search for examples


hilbertSciPy

hilbertSciPy( QDataSet ds ) → QDataSet

Perform the Hilbert function on the rank 1 dataset, similar to the scipy.signal.hilbert function in SciPy. The result is form differently than hilbert.

Parameters:

ds - rank 1 dataset of length n.

Returns:

ds[n,2], complex array

See Also:

hilbert(QDataSet)

search for examples


histogram

histogram( QDataSet ds, double min, double max, double binSize ) → QDataSet

returns a rank 1 dataset that is a histogram of the data. Note there will also be in the properties: count, the total number of valid values. nonZeroMin, the smallest non-zero, positive number

Parameters:

ds - rank N dataset
min - the min of the first bin. If min=-1 and max=-1, then automatically set the min and max.
max - the max of the last bin.
binSize - the size of each bin.

Returns:

a rank 1 dataset with each bin's count. DEPEND_0 indicates the bin locations.

search for examples


histogram

histogram( QDataSet ds, Datum min, Datum max, Datum binsize ) → QDataSet

returns a rank 1 dataset that is a histogram of the data. Note there will also be in the properties: count, the total number of valid values. nonZeroMin, the smallest non-zero, positive number

Parameters:

ds - rank N dataset
min - the center of the first bin. If min=-1 and max=-1, then automatically set the min and max.
max - the center of the last bin.
binsize - the size of each bin.

Returns:

a rank 1 dataset with each bin's count. DEPEND_0 indicates the bin locations.

search for examples


histogram

histogram( QDataSet ds, java.lang.String min, java.lang.String max, java.lang.String binsize ) → QDataSet

returns rank 1 dataset that is a histogram of the data. This will use the units of ds to interpret min, max, and binsize.

Parameters:

ds - rank N dataset
min - the center of the first bin. If min=-1 and max=-1, then automatically set the min and max.
max - the center of the last bin.
binsize - the size of each bin.

Returns:

QDataSet

search for examples


histogram

histogram( QDataSet ds, int binCount ) → QDataSet

returns a histogram of the dataset, based on the extent and scaletype of the data.

Parameters:

ds -
binCount - number of bins

Returns:

QDataSet

search for examples


histogram2d

histogram2d( QDataSet x, QDataSet y, int[] bins, QDataSet xrange, QDataSet yrange ) → QDataSet

make a 2-D histogram of the data in x and y. For example

x= randn(10000)+1
y= randn(10000)+4
zz= histogram2d( x,y, [30,30], dataset([0,8]), dataset([-2,6]) )
plot( zz )
The result will be a rank 2 dataset with DEPEND_0 and DEPEND_1 indicating the bin locations. If the xrange or yrange is dimensionless, then use the units of x or y.

Parameters:

x - the x values
y - the y values
bins - number of bins in x and y
xrange - a rank 1 2-element bounds dataset, so that Units can be specified.
yrange - a rank 1 2-element bounds dataset, so that Units can be specified.

Returns:

a rank 2 dataset

See Also:

histogram(QDataSet, double, double, double)
org.das2.qds.util.Reduction#histogram2D(QDataSet, QDataSet, QDataSet)

search for examples


ifft

ifft( QDataSet ds ) → QDataSet

Performs an inverse FFT on the provided rank 2 dataset of complex numbers.
A rank 2 dataset of complex numbers is returned.

Parameters:

ds - a rank 2 dataset.

Returns:

a rank 2 dataset of complex numbers.

See Also:

Ops#fft(QDataSet)

search for examples


ifft

ifft( QDataSet ds, QDataSet window, int stepFraction, ProgressMonitor mon ) → QDataSet

create the inverse fft of the real and imaginary spec

Parameters:

ds - rank 3 dataset of N,FFTLength,2
window -
stepFraction -
mon -

Returns:

QDataSet

search for examples


imax

imax( QDataSet ds ) → int

return the index of the maximum value. This is to avoid inefficient code like "where(slice.eq( max(slice) ))[0]"

Parameters:

ds - rank 1 dataset

Returns:

the index of the maximum value, or -1 if the data is all fill.

search for examples


imin

imin( QDataSet ds ) → int

return the index of the minimum value. This is to avoid inefficient code like "where(slice.eq( min(slice) ))[0]"

Parameters:

ds - rank 1 dataset

Returns:

the index of the maximum value, or -1 if the data is all fill.

search for examples


indgen

indgen( int len0 ) → QDataSet

returns rank 1 dataset with values [0,1,2,...] This returns an immutable dataset, so that it can be used in Jython like so: for i in indgen(200000). Note before February 2018, this would return a mutable dataset, and now this returns an IndexGenDataSet, which is immutable.

Parameters:

len0 -

Returns:

QDataSet

search for examples


indgen

indgen( int len0, int len1 ) → QDataSet

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

Parameters:

len0 -
len1 -

Returns:

QDataSet

search for examples


indgen

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

returns rank 3 dataset with values increasing

Parameters:

len0 -
len1 -
len2 -

Returns:

QDataSet

search for examples


intarr

intarr( int len0 ) → QDataSet

create a dataset filled with zeros, stored in 4-byte ints.

Parameters:

len0 - the zeroth dimension length

Returns:

rank 1 dataset filled with zeros.

See Also:

zeros(int)
dblarr(int)

search for examples


intarr

intarr( int len0, int len1 ) → QDataSet

create a rank 2 dataset filled with zeros, stored in 4-byte ints.

Parameters:

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

Returns:

rank 2 dataset filled with zeros.

search for examples


intarr

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

create a rank 3 dataset filled with zeros, stored in 4-byte ints.

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.

search for examples


interpolate

interpolate( QDataSet vv, QDataSet findex ) → QDataSet

interpolate values from rank 1 dataset vv using fractional indeces in rank N findex. For example, findex=1.5 means interpolate the 1st and 2nd indeces with equal weight, 1.1 means 90% of the first mixed with 10% of the second.
Only modest extrapolations where findex>=-0.5 and findex<=L-0.5 are allowed, where L is the number of points. The findex parameter must be dimensionless, to ensure that the caller is not passing in physical data.

Note there is no check on CADENCE. Note nothing is done with DEPEND_0, presumably because was already calculated and used for findex.

Here is an example use of this in Autoplot's Jython code:

 {@code
xx= [1,2,3,4]
yy= [2,4,5,4]
xxx= linspace(0,5,100)
yyy= interpolate( yy, findex(xx,xxx) )

plot( xx, yy, symbolSize=20 )
plot( addPlotElement(0), xxx, yyy )
 }
 

Parameters:

vv - rank 1 dataset having length L that is the data to be interpolated.
findex - rank N dataset of fractional indeces. This must be dimensionless, between -0.5 and L-0.5 and is typically calculated by the findex command.

Returns:

the result.

See Also:

interpolateMod interpolateMod, for data like longitude where 259 deg is 2 degrees away from 1 deg interpolateMod, for data like longitude where 259 deg is 2 degrees away from 1 deg

search for examples


interpolate

interpolate( QDataSet vv, QDataSet findex0, QDataSet findex1 ) → QDataSet

interpolate values from rank 2 dataset vv using fractional indeces in rank N findex, using bilinear interpolation. See also interpolateGrid.

Parameters:

vv - rank 2 dataset.
findex0 - rank N dataset of fractional indeces for the zeroth index. This must be dimensionless, between -0.5 and L-0.5 and is typically calculated by the findex command.
findex1 - rank N dataset of fractional indeces for the first index. This must be dimensionless, between -0.5 and L-0.5 and is typically calculated by the findex command.

Returns:

rank N dataset

See Also:

findex findex, the 1-D findex command findex, the 1-D findex command
interpolateGrid(QDataSet, QDataSet, QDataSet)

search for examples


interpolate

interpolate( QDataSet vv, QDataSet findex0, QDataSet findex1, QDataSet findex2 ) → QDataSet

interpolate values from rank 2 dataset vv using fractional indeces in rank N findex, using bilinear interpolation. See also interpolateGrid.

Parameters:

vv - rank 2 dataset.
findex0 - rank N dataset of fractional indeces for the zeroth index. This must be dimensionless, between -0.5 and L-0.5 and is typically calculated by the findex command.
findex1 - rank N dataset of fractional indeces for the first index. This must be dimensionless, between -0.5 and L-0.5 and is typically calculated by the findex command.
findex2 - rank N dataset of fractional indeces for the second index. This must be dimensionless, between -0.5 and L-0.5 and is typically calculated by the findex command.

Returns:

rank N dataset

See Also:

findex findex, the 1-D findex command findex, the 1-D findex command
interpolateGrid

search for examples


interpolateGrid

interpolateGrid( QDataSet vv, QDataSet findex0, QDataSet findex1 ) → QDataSet

interpolate values from rank 2 dataset vv using fractional indeces in rank N findex, using bilinear interpolation. Here the two rank1 indexes form a grid and the result is rank 2.

Parameters:

vv - rank 2 dataset.
findex0 - rank 1 dataset of fractional indeces for the zeroth index.
findex1 - rank 1 dataset of fractional indeces for the first index.

Returns:

rank 2 dataset

See Also:

findex findex, the 1-D findex command findex, the 1-D findex command

search for examples


interpolateMod

interpolateMod( QDataSet vv, QDataSet mod, QDataSet findex ) → QDataSet

like interpolate, but the findex is recalculated when the two bracketed points are closer in the modulo space than they would be in the linear space.

Parameters:

vv - rank 1 dataset that is the data to be interpolated. (e.g. longitude from 0 to 360deg)
mod - rank 0 dataset that is the mod of the space (e.g. 360deg), or rank 1 where the range is specified (e.g. -180 to 180).
findex - rank N dataset of fractional indeces. This must be dimensionless and is typically calculated by the findex command.

Returns:

the result, a rank 1 dataset with one element for each findex.

See Also:

interpolate(QDataSet,QDataSet)

search for examples


isAngleRange

isAngleRange( QDataSet ds, boolean strict ) → java.lang.Double

return true if the dataset can be interpreted as radian degrees from 0 to PI or from 0 to 2*PI.

Parameters:

ds - any QDataSet.
strict - return null if it's not clear that the units are degrees.

Returns:

the multiplier to make the dataset into radians, or null.

search for examples


isBundle

isBundle( QDataSet zds ) → boolean

return true if the dataset is a bundle. It is rank 2 or rank 1, and has the last dimension a bundle dimension.

Parameters:

zds - the dataset

Returns:

true if the dataset is a bundle.

See Also:

org.das2.qds.examples.Schemes

search for examples


isLegacyBundle

isLegacyBundle( QDataSet zds ) → boolean

return true if DEPEND_1 is set and its units are EnumerationUnits. This was the pre-bundle way of representing a bundle of datasets. It might be supported indefinitely, because it has some nice rules about the data. For example, bundled data must be of the same units since there is no place to put the property, and each bundled item must be rank 1.

Parameters:

zds - rank 1 or rank 2 dataset

Returns:

return true if DEPEND_1 is set and its units are EnumerationUnits.

search for examples


isSafeName

isSafeName( java.lang.String name ) → boolean

returns true if the name is a Java-style identifier, starting with one of a-z, A-Z, or _; followed by a-z, A-Z, 0-9, or _; and note that only ASCII characters are allowed.

Parameters:

name -

Returns:

true if the name is a safe identifier name.

search for examples


join

join( QDataSet ds2 ) → QDataSet

This one-argument join was used in a script that George had, so it must have been a function at some point.

Parameters:

ds2 - rank N dataset

Returns:

rank N+1 dataset

search for examples


join

join( QDataSet ds1, QDataSet ds2 ) → QDataSet

Join two rank N datasets to make a rank N+1 dataset, with the first dimension having two elements. This is the anti-slice operator.

If the first dataset is rank N+1 JoinDataset and the other is rank N, then the rank N dataset is added to the rank N+1 dataset.

This is underimplemented right now, and can only join two rank N datasets or if the first dataset is the result of a join.

Parameters:

ds1 - rank N dataset, or null
ds2 - rank N dataset

Returns:

rank N+1 dataset

See Also:

slices
concatenate

search for examples


labels

labels( java.lang.String[] labels, java.lang.String context ) → QDataSet

create a labels dataset for tagging rows of a dataset. If the context has been used already, including "default", then the EnumerationUnit for the data will be preserved. labels(["red","green","blue"],"default") will always return an equivalent (and comparable) result during a session.

Example: dep1= labels( ["X","Y","Z"], "GSM" )

Parameters:

labels - array of string labels
context - the namespace for the labels, to provide control over String→int mapping.

Returns:

rank 1 QDataSet

See Also:

labelsDataset(java.lang.String[])

search for examples


labels

labels( java.lang.String[] labels ) → QDataSet

create a labels dataset for tagging rows of a dataset. Example: dep1= labels( ["red","greed","blue"] )

Parameters:

labels - array of string labels

Returns:

rank 1 QDataSet

See Also:

labelsDataset(java.lang.String[])

search for examples


labelsDataset

labelsDataset( java.lang.String[] labels, java.lang.String context ) → QDataSet

create a labels dataset for tagging rows of a dataset. If the context has been used already, including "default", then the EnumerationUnit for the data will be preserved. labels(["red","green","blue"],"default") will always return an equivalent (and comparable) result during a session.

Example: dep1= labels( ["X","Y","Z"], "GSM" )

Parameters:

labels - array of string labels
context - the namespace for the labels, to provide control over String→int mapping.

Returns:

rank 1 QDataSet

search for examples


labelsDataset

labelsDataset( java.lang.String[] labels ) → QDataSet

create a labels dataset for tagging rows of a dataset. Example: array of string labels dep1= labels( ["red","greed","blue"] )

Parameters:

labels -

Returns:

rank 1 QDataSet

search for examples


le

le( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise function returns 1 where ds1<=ds2.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

search for examples


lesserOf

lesserOf( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise function returns the smaller of ds1 and ds2. If an element of ds1 or ds2 is fill, then the result is fill.

Parameters:

ds1 -
ds2 -

Returns:

the smaller of the two, in the units of ds1.

search for examples


link

link( QDataSet x, QDataSet y ) → QDataSet

link is the fundamental operator where we declare that one dataset is dependent on another. For example link(x,y) creates a new dataset where y is the dependent variable of the independent variable x. link is like the plot command, but doesn't plot. For example

plot(X,Y) shows a plot of Y(X),
link(X,Y) returns the dataset Y(X).

Parameters:

x - rank 1 dataset
y - rank 1 or rank 2 bundle dataset

Returns:

rank 1 dataset with DEPEND_0 set to x.

search for examples


link

link( QDataSet x, QDataSet y, QDataSet z ) → QDataSet

link is the fundamental operator where we declare that one dataset is dependent on another. For example link(x,y,z) creates a new dataset where z is the dependent variable of the independent variables x and y. link is like the plot command, but doesn't plot. For example

   plot(x,y,z) shows a plot of Z(X,Y),
   link(x,y,z) returns the dataset Z(X,Y).
Note if z is a rank 1 dataset, then a bundle dataset Nx3 is returned, and names are assigned to the datasets

Parameters:

x - rank 1 dataset
y - rank 1 dataset
z - rank 1 or 2 dataset.

Returns:

rank 1 or 2 dataset with DEPEND_0 and DEPEND_1 set to X and Y.

search for examples


link

link( QDataSet d0, QDataSet d1, QDataSet d2, QDataSet z ) → QDataSet

like bundle, but declare the last dataset is dependent on the first three.

Parameters:

d0 - rank 1 dataset
d1 - rank 1 dataset
d2 - rank 1 dataset
z - rank 1 or rank 3 dataset.

Returns:

rank 2 bundle when z is rank 1, or a rank 3 dataset when z is rank 3.

search for examples


linspace

linspace( double min, double max, int len0 ) → QDataSet

return a rank 1 dataset with len0 linearly-spaced values, the first is min and the last is max.

Parameters:

min - double
max - double
len0 - number of elements in the result

Returns:

rank 1 dataset of linearly spaced data.

search for examples


linspace

linspace( Object omin, Object omax, int len0 ) → QDataSet

return a rank 1 dataset with len0 linearly-spaced values, the first is min and the last is max.

Parameters:

omin - rank 0 dataset
omax - rank 0 dataset
len0 - number of elements in the result

Returns:

rank 1 dataset of linearly spaced data.

search for examples


log

log( QDataSet ds ) → QDataSet

element-wise natural logarithm.

Parameters:

ds -

Returns:

QDataSet

search for examples


log10

log10( QDataSet ds ) → QDataSet

element-wise base 10 logarithm.

Parameters:

ds -

Returns:

QDataSet

search for examples


logspace

logspace( double min, double max, int len0 ) → QDataSet

return a rank 1 dataset with len0 logarithmically-spaced values, the first is min and the last is max.

Parameters:

min - double
max - double
len0 - number of elements in the result

Returns:

rank 1 dataset of logarithmically spaced data.

search for examples


logspace

logspace( Object omin, Object omax, int len0 ) → QDataSet

return a rank 1 dataset with len0 logarithmically-spaced values, the first is min and the last is max.

Parameters:

omin - rank 0 dataset
omax - rank 0 dataset
len0 - number of elements in the result

Returns:

rank 1 dataset of logarithmically spaced data.

search for examples


lt

lt( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise function returns 1 where ds1<ds2.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

search for examples


magnitude

magnitude( QDataSet ds ) → QDataSet

return the magnitudes of vectors in a rank 1 or greater dataset (typically rank 2). The last index should be the cartesian dimension. For example,

{@code
 ds= getDataSet('http://autoplot.org/data/autoplot.cdf?BGSM') # BGSM[Epoch=24,cart=3]
 m= magnitude(ds)
}
For rank 0, this just returns the absolute value, but with the same units.

Parameters:

ds - dataset of Rank N.

Returns:

dataset of Rank N-1.

See Also:

abs(QDataSet)

search for examples


maybeCopy

maybeCopy( QDataSet ads0 ) → WritableDataSet

Copy the dataset to an ArrayDataSet only if the dataset is not already an ArrayDataSet or BufferDataSet. Note this does not consider the mutability of the data. If the dataset is not mutable, then the original data could be returned (probably).

Parameters:

ads0 - a dataset.

Returns:

an ArrayDataSet or BufferDataSet

search for examples


mean

mean( QDataSet ds ) → QDataSet

Mean function that returns the average of the valid elements of a rank N dataset

Parameters:

ds - rank N dataset

Returns:

rank 0 dataset

See Also:

mode
median
variance(QDataSet)
meanAverageDeviation(QDataSet)

search for examples


meanAverageDeviation

meanAverageDeviation( QDataSet ds ) → QDataSet

return the Mean Average Deviation (MAD) of the rank N dataset.
The result will contain the USER_PROPERTIES with a map containing the mean and number of points.

Parameters:

ds - the rank N dataset.

Returns:

the rank 0 mean average deviation of the dataset.

See Also:

mean(QDataSet)
BinAverage#binMeanAverageDeviation(QDataSet, QDataSet)

search for examples


median

median( Object o ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


median

median( QDataSet ds ) → QDataSet

Median function that sorts a rank N dataset and returns its median.
If lists are equal in size (even number of elements), always choose first element of 'more' list

Parameters:

ds - rank N dataset.

Returns:

rank 0 dataset

See Also:

mean
mode

search for examples


medianFilter

medianFilter( QDataSet ds, int size ) → QDataSet

1-D median filter with a boxcar of the given size. The first size/2 elements, and the last size/2 elements are copied from the input.

Parameters:

ds - rank 1 or rank 2 dataset. Future implementations may support higher rank data.
size - the boxcar size

Returns:

rank 1 or rank 2 dataset.

See Also:

smooth(QDataSet, int)

search for examples


merge

merge( QDataSet ds1, QDataSet ds2 ) → QDataSet

Merge the two sorted rank N datasets, using their DEPEND_0 datasets, into one rank N dataset.
If neither dataset has DEPEND_0, then this will use the datasets themselves. When ds1 occurs "before" ds2, then this is the same as concatenate. When there is a collision where two data points are coincident, use ds1[j]. This is fuzzy, based on the depend_0 cadence of ds1. When ds1 is null (or None), use ds2. Thanks to: http://stackoverflow.com/questions/5958169/how-to-merge-two-sorted-arrays-into-a-sorted-array

Parameters:

ds1 - rank N dataset, or null.
ds2 - rank N dataset

Returns:

dataset of rank N with elements interleaved.

See Also:

concatenate(QDataSet, QDataSet)

search for examples


mod

mod( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise mod of two datasets with compatible geometry. This should support Units.t2000 mod "24 hours" to get result in hours.

Parameters:

ds1 - the numerator
ds2 - the divisor

Returns:

the remainder after the division

search for examples


mode

mode( QDataSet ds ) → QDataSet

return the most frequently occurring element of the valid elements of a rank N dataset

Parameters:

ds - rank N dataset.

Returns:

the rank 0 dataset

See Also:

mean
median

search for examples


modp

modp( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise mod of two datasets with compatible geometry. This returns a positive number for -18 % 10. This is Python's behavior. This should support Units.t2000 mod "24 hours" to get result in hours.

Parameters:

ds1 - the numerator
ds2 - the divisor

Returns:

the remainder after the division

search for examples


monotonicSubset

monotonicSubset( QDataSet ds ) → MutablePropertyDataSet

ensure that there are no non-monotonic or repeat records, by removing the first N-1 records of N repeated records.

Warning: this was extracted from AggregatingDataSource to support BufferDataSets, and is minimally implemented.

When ds has property QDataSet.DEPEND_0, then this is used to identify the monotonic subset. When ds is a set of timetags, then these are used.

Parameters:

ds - MutablePropertyDataSet, which must be writable.

Returns:

dataset, possibly with records removed.

search for examples


multiply

multiply( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise multiply of two datasets with compatible geometry. Presently, either ds1 or ds2 should be dimensionless. TODO: units improvements.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

See Also:

multiplyUnits

search for examples


ne

ne( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise not equal test. 1.0 is returned where elements are not equal. Fill is returned where either measurement is invalid.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

search for examples


negate

negate( QDataSet ds1 ) → QDataSet

return a dataset with each element negated. If units are specified, Units must be ratiometric units, like "5 km" or dimensionless, and not ordinal or time location units.

Parameters:

ds1 -

Returns:

QDataSet

See Also:

copysign
signum

search for examples


neighborFill

neighborFill( QDataSet ds ) → QDataSet

fill in the missing values by copying nearest data points. All data in the result will be copies of elements found in the result, but no regard is given to how far a point is shifted. This was motivated by supporting fill in median.

Parameters:

ds -

Returns:

dataset that does not contain fill.

search for examples


normalize

normalize( QDataSet ds ) → QDataSet

normalize the data so that the max is 1, where we normalize by the biggest

Parameters:

ds -

Returns:

dataset with the same geometry as ds.

search for examples


not

not( QDataSet ds1 ) → QDataSet

element-wise logical not function. non-zero is true, zero is false.

Parameters:

ds1 -

Returns:

QDataSet

See Also:

bitwiseXor(QDataSet, QDataSet)

search for examples


ones

ones( int len0 ) → QDataSet

return new dataset filled with ones.

Parameters:

len0 - the length of the first index.

Returns:

dataset filled with ones.

search for examples


ones

ones( int len0, int len1 ) → QDataSet

return a rank two dataset filled with ones. This is currently mutable, but future versions may not be.

Parameters:

len0 - the length of the first index.
len1 - the length of the second index.

Returns:

dataset filled with ones.

search for examples


ones

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

return new dataset filled with ones.

Parameters:

len0 - the length of the first index.
len1 - the length of the second index.
len2 - the length of the third index.

Returns:

dataset filled with ones.

search for examples


ones

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

return new dataset filled with ones.

Parameters:

len0 - the length of the first index.
len1 - the length of the second index.
len2 - the length of the third index.
len3 - the length of the fourth index.

Returns:

dataset filled with ones.

search for examples


or

or( QDataSet ds1, QDataSet ds2 ) → QDataSet

element-wise logical or function.
returns 1 where ds1 is non-zero or ds2 is non-zero.

Parameters:

ds1 -
ds2 -

Returns:

QDataSet

See Also:

bitwiseOr(QDataSet, QDataSet)

search for examples


outerProduct

outerProduct( QDataSet ds1, QDataSet ds2 ) → QDataSet

returns outerProduct of two rank 1 datasets, a rank 2 dataset with elements R[i,j]= ds1[i] * ds2[j].

Parameters:

ds1 - rank 1 dataset length m.
ds2 - rank 1 dataset of length n.

Returns:

rank 2 dataset that is m by n.

search for examples


outerSum

outerSum( QDataSet ds1, QDataSet ds2 ) → QDataSet

returns outerSum of two rank 1 datasets, a rank 2 dataset with elements R[i,j]= ds1[i] + ds2[j].

Parameters:

ds1 - a rank 1 dataset of length m
ds2 - a rank 1 dataset of length n

Returns:

a rank 2 dataset[m,n]

search for examples


polarToCartesian

polarToCartesian( QDataSet ds ) → QDataSet

converts a rank 2 bundle of polar data, where ds[:,0] are the radii and ds[:,1] are the angles. Any additional bundled datasets are left alone.

Parameters:

ds -

Returns:

bundle of X, Y, and remaining data.

search for examples


pow

pow( QDataSet ds1, QDataSet pow ) → QDataSet

element-wise pow (** in FORTRAN, ^ in IDL) of two datasets with the compatible geometry.

Parameters:

ds1 - the base
pow - the exponent

Returns:

the value ds1**pow

search for examples


putBundleProperty

putBundleProperty( QDataSet ds, java.lang.String name, int index, Object value ) → MutablePropertyDataSet

Like putIndexedProperty, but manages the bundle for the client. This was introduced to make it easier to work with bundles. This converts types often seen in Jython and Java codes to the correct type. For example, {@code ds= putBundleProperty( ds, 'UNITS', 0, 'seconds since 2012-01-01')}.
The dataset may be copied to make it mutable. If the bundle descriptor dataset is not found, it is added, making the rank 2 dataset a bundle.

Parameters:

ds - the rank 1 or rank 2 bundle dataset to which the property is to be set.
name - the property name
index - the property index
value - the property value, which can converted to the proper type.

Returns:

the dataset, possibly converted to a mutable dataset.

search for examples


putIndexedProperty

putIndexedProperty( QDataSet ds, java.lang.String name, int index, Object value ) → MutablePropertyDataSet

Like putProperty, but this inserts the value at the index. This was introduced to make it easier to work with bundles. This converts types often seen in Jython and Java codes to the correct type. For example, {@code bds= putProperty( bds, 'UNITS', 0, 'seconds since 2012-01-01')}.
The dataset may be copied to make it mutable.

Parameters:

ds - the dataset to which the property is to be set.
name - the property name
index - the property index
value - the property value, which can converted to the proper type.

Returns:

the dataset, possibly converted to a mutable dataset.

search for examples


putProperty

putProperty( Object ds, java.lang.String name, Object value ) → MutablePropertyDataSet

converts types often seen in Jython and Java codes to the correct type. For example,

ds= putProperty( [1400,2800], 'UNITS', 'seconds since 2012-01-01')

will convert the string 'seconds since 2012-01-01' into a Unit before assigning it to the dataset.

Parameters:

ds - the object which can be interpreted as a dataset, such as a number or array of numbers.
name - the property name
value - the property value, which can converted to the proper type.

Returns:

the dataset, possibly converted to a mutable dataset.

search for examples


putProperty

putProperty( QDataSet ds, java.lang.String name, Object value ) → MutablePropertyDataSet

converts types often seen in Jython and Java codes to the correct type. For example, ds= putProperty( ds, 'UNITS', 'seconds since 2012-01-01'). The dataset may be copied to make it mutable.

Parameters:

ds - the dataset to which the property is to be set.
name - the property name
value - the property value, which can converted to the proper type.

Returns:

the dataset, possibly converted to a mutable dataset.

search for examples


putValues

putValues( Object ds, Object indeces, Object values ) → WritableDataSet

Parameters:

Returns:

WritableDataSet

search for examples


putValues

putValues( QDataSet ds, QDataSet indeces, QDataSet value ) → WritableDataSet

like putProperty, but this inserts values into the dataset. If the dataset is not mutable, then this will make a copy of the data and return the copy.

Parameters:

ds - the rank 1 or greater dataset
indeces - rank 1 indeces when ds is rank 1, or rank 2 [:,m] indeces for a rank m dataset.
value - null for fill, or the rank 0 value or rank 1 values to assign.

Returns:

the dataset with the indeces assigned new values.

See Also:

where(QDataSet)
removeValues(QDataSet, QDataSet)

search for examples


rand

rand( ) → QDataSet

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

Parameters:

Returns:

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

search for examples


rand

rand( int len0 ) → QDataSet

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

Parameters:

len0 - the number of elements in the result.

Returns:

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

search for examples


rand

rand( int len0, int len1 ) → QDataSet

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.

Returns:

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

search for examples


rand

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

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.
len2 - the number of elements in the third index.

Returns:

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

search for examples


randn

randn( ) → QDataSet

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

Parameters:

Returns:

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

search for examples


randn

randn( int len0 ) → QDataSet

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

Parameters:

len0 - the number of elements in the first index.

Returns:

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

search for examples


randn

randn( int len0, int len1 ) → QDataSet

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.

Returns:

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

search for examples


randn

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

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.
len2 - the number of elements in the third index.

Returns:

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

search for examples


randn

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

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.
len2 - the number of elements in the third index.
len3 - the number of elements in the fourth index.

Returns:

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

search for examples


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.

Parameters:

Returns:

the seed is returned.

search for examples


randomSeed

randomSeed( long seed ) → long

reset the random sequence used by randu and randn to the given seed.

Parameters:

seed - the new seed for the sequence.

Returns:

the seed (which will be the same as the input).

search for examples


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


randomn

randomn( long seed, int len0 ) → QDataSet

returns a rank 1 dataset of random numbers of a Gaussian (normal) distribution. System.currentTimeMillis() may be used for the seed.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index

Returns:

rank 1 dataset of normal distribution

search for examples


randomn

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

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

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index
len1 - number of elements in the second index

Returns:

rank 2 dataset of normal distribution

search for examples


randomn

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

returns a rank 3 dataset of random numbers of a gaussian (normal) distribution.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index
len1 - number of elements in the second index
len2 - number of elements in the third index

Returns:

rank 3 dataset of normal distribution

search for examples


randomn

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

returns a rank 3 dataset of random numbers of a gaussian (normal) distribution.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index
len1 - number of elements in the second index
len2 - number of elements in the third index
len3 - number of elements in the fourth index

Returns:

rank 4 dataset of normal distribution

search for examples


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


randomu

randomu( long seed, int len0 ) → QDataSet

returns a rank 1 dataset of random numbers of a uniform distribution. System.currentTimeMillis() may be used for the seed.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index

Returns:

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

search for examples


randomu

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

returns a rank 2 dataset of random numbers of a uniform distribution.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index
len1 - number of elements in the second index

Returns:

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

search for examples


randomu

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

returns a rank 3 dataset of random numbers of a uniform distribution.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index
len1 - number of elements in the second index
len2 - number of elements in the third index

Returns:

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

search for examples


randomu

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

returns a rank 3 dataset of random numbers of a uniform distribution.

Parameters:

seed - basis for the random number (which will not be modified).
len0 - number of elements in the first index
len1 - number of elements in the second index
len2 - number of elements in the third index
len3 - number of elements in the fourth index

Returns:

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

search for examples


randu

randu( ) → QDataSet

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

Parameters:

Returns:

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

search for examples


randu

randu( int len0 ) → QDataSet

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

Parameters:

len0 - the number of elements in the result.

Returns:

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

search for examples


randu

randu( int len0, int len1 ) → QDataSet

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.

Returns:

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

search for examples


randu

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

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.
len2 - the number of elements in the third index.

Returns:

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

search for examples


randu

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

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

Parameters:

len0 - the number of elements in the first index.
len1 - the number of elements in the second index.
len2 - the number of elements in the third index.
len3 - the number of elements in the fourth index.

Returns:

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

search for examples


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


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


reduceMax

reduceMax( QDataSet ds, int dim, ProgressMonitor mon ) → 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.
mon - progress monitor

Returns:

rank N-1 dataset.

search for examples


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


reduceMean

reduceMean( QDataSet ds, int dim, ProgressMonitor mon ) → 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.
mon - progress monitor.

Returns:

rank N-1 qube dataset

search for examples


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


reduceMin

reduceMin( QDataSet ds, int dim ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


reduceMin

reduceMin( QDataSet ds, int dim, ProgressMonitor mon ) → 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.
mon - progress monitor

Returns:

rank N-1 dataset.

search for examples


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


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 indeces 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


reform

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

allow reform record-by-record, which comes up often.

Parameters:

ds - rank 2 or greater dataset of length nrec.
nrec - number of records in ds
qube - length nn array with the new geometry of each record.

Returns:

ds of rank nn+1.

search for examples


reform

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

change the dimensionality of the elements of the QUBE dataset. For example, convert [1,2,3,4,5,6] to 1,2],[3,4],[5,6.

Parameters:

ds - dataset
qube - the dimensions of the result dataset.

Returns:

a new dataset with the specified dimensions, and the properties (e.g. UNITS) of the input dataset.

search for examples


removeFill

removeFill( QDataSet ds ) → 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 -

Returns:

dataset with the values removed.

search for examples


removeIndeces

removeIndeces( QDataSet vv, QDataSet indeces ) → QDataSet

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

 {@code
 ds= ripples(20)
 ds= removeIndeces( ds, where( valid(ds).eq(0) ) )
 print ds.length()
 }
 

Parameters:

vv - a rank 1 dataset
indeces - the indeces 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


removeValues

removeValues( QDataSet ds, QDataSet indeces ) → WritableDataSet

put fill data for these indeces

Parameters:

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

Returns:

the dataset with the data at the indeces made invalid.

See Also:

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

search for examples


removeValuesGreaterThan

removeValuesGreaterThan( QDataSet ds, QDataSet v ) → 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


removeValuesLessThan

removeValuesLessThan( QDataSet ds, QDataSet v ) → 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


replicate

replicate( short val, int len0 ) → WritableDataSet

returns rank 1 dataset with value

Parameters:

val - fill the dataset with this value.
len0 -

Returns:

WritableDataSet

search for examples


replicate

replicate( short val, int len0, int len1 ) → WritableDataSet

returns rank 2 dataset filled with value

Parameters:

val - fill the dataset with this value.
len0 -
len1 -

Returns:

WritableDataSet

search for examples


replicate

replicate( short val, int len0, int len1, int len2 ) → WritableDataSet

returns rank 3 dataset with filled with value.

Parameters:

val - fill the dataset with this value.
len0 -
len1 -
len2 -

Returns:

WritableDataSet

search for examples


replicate

replicate( int val, int len0 ) → WritableDataSet

returns rank 1 dataset with value

Parameters:

val - fill the dataset with this value.
len0 -

Returns:

WritableDataSet

search for examples


replicate

replicate( int val, int len0, int len1 ) → WritableDataSet

returns rank 2 dataset filled with value

Parameters:

val - fill the dataset with this value.
len0 -
len1 -

Returns:

WritableDataSet

search for examples


replicate

replicate( int val, int len0, int len1, int len2 ) → WritableDataSet

returns rank 3 dataset with filled with value.

Parameters:

val - fill the dataset with this value.
len0 -
len1 -
len2 -

Returns:

WritableDataSet

search for examples


replicate

replicate( long val, int len0 ) → WritableDataSet

returns rank 1 dataset with value

Parameters:

val - fill the dataset with this value.
len0 -

Returns:

WritableDataSet

search for examples


replicate

replicate( long val, int len0, int len1 ) → WritableDataSet

returns rank 2 dataset filled with value

Parameters:

val - fill the dataset with this value.
len0 -
len1 -

Returns:

WritableDataSet

search for examples


replicate

replicate( long val, int len0, int len1, int len2 ) → WritableDataSet

returns rank 3 dataset with filled with value.

Parameters:

val - fill the dataset with this value.
len0 -
len1 -
len2 -

Returns:

WritableDataSet

search for examples


replicate

replicate( double val, int len0 ) → WritableDataSet

returns rank 1 dataset with value

Parameters:

val - fill the dataset with this value.
len0 -

Returns:

WritableDataSet

search for examples


replicate

replicate( double val, int len0, int len1 ) → WritableDataSet

returns rank 2 dataset filled with value

Parameters:

val - fill the dataset with this value.
len0 -
len1 -

Returns:

WritableDataSet

search for examples


replicate

replicate( double val, int len0, int len1, int len2 ) → WritableDataSet

returns rank 3 dataset with filled with value.

Parameters:

val - fill the dataset with this value.
len0 -
len1 -
len2 -

Returns:

WritableDataSet

search for examples


replicate

replicate( double val, int len0, int len1, int len2, int len3 ) → WritableDataSet

returns rank 4 dataset with filled with value.

Parameters:

val - fill the dataset with this value.
len0 -
len1 -
len2 -
len3 -

Returns:

WritableDataSet

search for examples


replicate

replicate( float val, int len0 ) → WritableDataSet

returns rank 1 dataset with value

Parameters:

val - fill the dataset with this value.
len0 -

Returns:

WritableDataSet

search for examples


replicate

replicate( float val, int len0, int len1 ) → WritableDataSet

returns rank 2 dataset filled with value

Parameters:

val - fill the dataset with this value.
len0 -
len1 -

Returns:

WritableDataSet

search for examples


replicate

replicate( float val, int len0, int len1, int len2 ) → WritableDataSet

returns rank 3 dataset with filled with value.

Parameters:

val - fill the dataset with this value.
len0 -
len1 -
len2 -

Returns:

WritableDataSet

search for examples


replicate

replicate( QDataSet val, int len0 ) → MutablePropertyDataSet

returns a rank N+1 dataset by repeating the rank N dataset, so all records will have the same value. E.g. result.value(i,j)= val.value(j)

Parameters:

val - the rank N dataset
len0 - the number of times to repeat

Returns:

rank N+1 dataset.

search for examples


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 1 dataset (TODO: easily modify this to support rank N)
min - rank 0 min
max - rank 0 max

Returns:

rescaled data.

search for examples


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


rescaleRangeLogLin

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

like rescaleRange, but look at log/lin flag.

Parameters:

dr -
min -
max -

Returns:

two-element rank 1 QDataSet

See Also:

QDataSet#SCALE_TYPE

search for examples


reverse

reverse( QDataSet ds ) → QDataSet

returns the reverse of the rank 1 dataset.

Parameters:

ds -

Returns:

QDataSet

search for examples


rgbColorDataset

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

create a dataset of RGB colors. The output is int(red)256256 + 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.

search for examples


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


ripples

ripples( int len0, int len1 ) → QDataSet

rank 2 dataset for demos and testing.

Parameters:

len0 - number of elements in the first index
len1 - number of elements in the second index

Returns:

rank 2 dataset for demos and testing.

search for examples


ripples

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

rank 3 dataset for demos and testing.

Parameters:

len0 - number of elements in the first index
len1 - number of elements in the second index
len2 - number of elements in the third index

Returns:

rank 3 dataset for demos and testing.

search for examples


ripples

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

rank 4 dataset for demos and testing.

Parameters:

len0 - number of elements in the first index
len1 - number of elements in the second index
len2 - number of elements in the third index
len3 - number of elements in the fourth index

Returns:

rank 4 dataset for demos and testing.

search for examples


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


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.

Parameters:

Returns:

an example pitch angle distribution.

search for examples


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


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


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


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


round

round( QDataSet ds1 ) → QDataSet

element-wise round function. 0.5 is round up.

Parameters:

ds1 -

Returns:

QDataSet

search for examples


round

round( QDataSet ds1, int ndigits ) → QDataSet

element-wise round function, which rounds to i decimal places. 0.5 is round up.

Parameters:

ds1 - the dataset.
ndigits - round to this number of digits after the decimal point (e.g. 1=0.1 2=0.01 -1=10)

Returns:

dataset with the same geometry with each value rounded.

search for examples


safeName

safeName( java.lang.String suggest ) → java.lang.String

made a Java-style identifier from the provided string See Autoplot/src/scripts/safeName.jy which demonstrates this.

Parameters:

suggest - a name, possibly containing spaces and illegal characters

Returns:

a Java-style identifier

search for examples


saferName

saferName( java.lang.String suggest ) → java.lang.String

extra spaces and pipes cause problems in the Operations text field. Provide so that data sources can provide safer names, while we test safe-name requirements on a broader test set. Use of this method will allow us to see where changes are needed. TODO: where is this used?

Parameters:

suggest - a name, possibly containing pipes (|)

Returns:

suggest, but with pipe converted to underscore.

search for examples


sawtooth

sawtooth( QDataSet t ) → QDataSet

generates a sawtooth from the tags, where a peak occurs with a period 2*PI. All values of T should be ge zero. TODO: I think there should be a modp function that is always positive. (-93 % 10 →7 though...)

Parameters:

t - the independent values

Returns:

/|/|/| sawtooth wave with a period of 2 PI.

search for examples


shortarr

shortarr( int len0 ) → QDataSet

create a dataset filled with zeros, stored in 2-byte signed shorts. Note that shortarr is equivalent to intarr in IDL, containing integer values from -32768 to 32767.

Parameters:

len0 - the zeroth dimension length

Returns:

rank 1 dataset filled with zeros.

See Also:

zeros(int)
dblarr(int)

search for examples


shortarr

shortarr( int len0, int len1 ) → QDataSet

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

Parameters:

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

Returns:

rank 2 dataset filled with zeros.

search for examples


shortarr

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

create a rank 3 dataset filled with zeros, stored in 2-byte shorts.

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.

search for examples


shuffle

shuffle( QDataSet ds ) → QDataSet

returns a rank 1 dataset of indeces that shuffle the rank 1 dataset ds

s= shuffle( ds )
dsShuffled= ds[s]

Parameters:

ds - rank 1 dataset

Returns:

rank 1 dataset of integer indeces.

See Also:

sort(QDataSet)

search for examples


signum

signum( QDataSet ds1 ) → QDataSet

Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero.

Parameters:

ds1 -

Returns:

QDataSet

See Also:

copysign
negate

search for examples


sin

sin( QDataSet ds ) → QDataSet

element-wise sin.

Parameters:

ds -

Returns:

QDataSet

search for examples


sinh

sinh( QDataSet ds ) → QDataSet

element-wise sinh.

Parameters:

ds -

Returns:

QDataSet

search for examples


size

size( QDataSet ds ) → int[]

returns the number of elements in each index. E.g:

 ds= zeros(3,4)
 print size(ds) # returns "3,4"
 
Note datasets need not have the same number of elements in each record. This is often the case however, and a "qube" dataset has this property.

Parameters:

ds - a qube dataset.

Returns:

the array containing number of elements in each index.

search for examples


slice0

slice0( QDataSet ds, int idx ) → QDataSet

Parameters:

ds - the rank N (N>0) or more dataset
idx - the index

Returns:

rank N-1 dataset

See Also:

QDataSet#slice(int)

search for examples


slice0

slice0( QDataSet ds, QDataSet sliceds ) → QDataSet

returns the slice at the given slice location. The dataset must have monotonic DEPEND_0.

Parameters:

ds - ripples(20,20). Presently this must be a simple table.
sliceds - dataset("10.3")

Returns:

the slice at the given location

See Also:

trim(QDataSet, QDataSet, QDataSet)

search for examples


slice1

slice1( QDataSet ds, int idx ) → QDataSet

Parameters:

ds -
idx -

Returns:

QDataSet

See Also:

org.das2.qds.DataSetOps#slice1(QDataSet, int)

search for examples


slice1

slice1( QDataSet ds, QDataSet sliceds ) → QDataSet

returns the slice at the given slice location.

Parameters:

ds - ripples(20,20). Presently this must be a simple table.
sliceds - dataset("10.3")

Returns:

QDataSet

search for examples


slice2

slice2( QDataSet ds, int idx ) → QDataSet

Parameters:

ds -
idx -

Returns:

QDataSet

See Also:

org.das2.qds.DataSetOps#slice2(QDataSet, int)

search for examples


slice2

slice2( QDataSet ds, QDataSet sliceds ) → QDataSet

returns the slice at the given slice location.

Parameters:

ds - ripples(20,20). Presently this must be a simple table.
sliceds - dataset("10.3")

Returns:

QDataSet

search for examples


slice3

slice3( QDataSet ds, int idx ) → QDataSet

Parameters:

ds -
idx -

Returns:

QDataSet

See Also:

org.das2.qds.DataSetOps#slice3(QDataSet, int)

search for examples


slice3

slice3( QDataSet ds, QDataSet sliceds ) → QDataSet

returns the slice at the given slice location.

Parameters:

ds - ripples(20,20). Presently this must be a simple table.
sliceds - dataset("10.3")

Returns:

QDataSet

search for examples


slices

slices( QDataSet ds, java.lang.Object[] args ) → QDataSet

slice each dimension in one call, so that chaining isn't required to slice multiple dimensions at once.

Parameters:

ds - the dataset
args - varargs list of integers that are slice indeces, or "" or ":" to mean don't slice

Returns:

the dataset with slices performed.

search for examples


smooth

smooth( QDataSet ds, int size ) → QDataSet

run boxcar average over the dataset, returning a dataset of same geometry. Points near the edge are simply copied from the source dataset. The result dataset contains a property "weights" that is the weights for each point.

For rank 2 datasets, the smooth is done on the zeroth dimension, typically time. Note IDL does the smooth in both X and Y.

Parameters:

ds - a rank 1 or rank 2 dataset of length N
size - the number of adjacent bins to average

Returns:

rank 1 or rank 2 dataset of length N

See Also:

smooth2d(QDataSet, int, int)

search for examples


smooth1

smooth1( QDataSet ds, int size ) → QDataSet

smooth over the first dimension (not the zeroth). For example, for ds[Time,Energy], this will smooth over energy.

Parameters:

ds - rank 2 dataset.
size - the boxcar size

Returns:

smoothed dataset with the same geometry.

search for examples


smooth2d

smooth2d( QDataSet ds, int n0, int n1 ) → QDataSet

smooth in both the first and second dimensions. Presently, this just calls smooth and then smooth1.

Parameters:

ds - rank 2 data
n0 - the boxcar size in the first dimension
n1 - the boxcar size in the second dimension

Returns:

data with the same geometry

See Also:

smooth(QDataSet, int)
smooth1(QDataSet, int)

search for examples


smoothFit

smoothFit( QDataSet xx, QDataSet yy, int size ) → QDataSet

run boxcar average over the dataset, returning a dataset of same geometry.
Points near the edge are fit to a line and replaced. The result dataset contains a property "weights" that is the weights for each point.

Parameters:

xx - a rank 1 dataset of size N
yy - a rank 1 dataset of size N
size - the number of adjacent bins to average. If size is greater than yy.length, size is reset to yy.length.

Returns:

rank 1 dataset of size N

search for examples


sort

sort( QDataSet ds ) → QDataSet

returns a rank 1 dataset of indeces that sort the rank 1 dataset ds. This is not the dataset sorted. For example:

ds= randn(2000)
s= sort( ds )
dsSorted= ds[s]
Note the result will have the property MONOTONIC==Boolean.TRUE if the data was sorted already.

Parameters:

ds - rank 1 dataset

Returns:

rank 1 dataset of indeces that sort the input dataset.

See Also:

shuffle(QDataSet)

search for examples


sqrt

sqrt( QDataSet ds ) → QDataSet

element-wise sqrt. See Ops.pow to square a number.

Parameters:

ds - the dataset

Returns:

the square root of the dataset, which will contain NaN where the data is negative.

See Also:

pow(QDataSet, QDataSet)

search for examples


square

square( QDataSet t ) → QDataSet

generates a square from the tags, where a the signal is 1 from 0-PI, 0 from PI-2*PI, etc.

Parameters:

t - the independent values.

Returns:

square wave with a period of 2 PI.

search for examples


stddev

stddev( Object o ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


stddev

stddev( QDataSet ds ) → QDataSet

standard deviation function.

Parameters:

ds - rank N dataset.

Returns:

rank 0 dataset with units matching those of the input.

search for examples


subset

subset( QDataSet ds, QDataSet w ) → QDataSet

return the data at the indices given. This will be a rank 1 QDataSet. Often the indices are created with the "where" function, for example: QDataSet r= Ops.subset( ds, Ops.where( Ops.gt( ds, 1 ) ) ) will return the subset of ds where ds is greater than 1.

Parameters:

ds - rank N array, N > 0.
w - rank 1 dataset of length l indexing a rank 1 array, or rank 2 ds[l,N] indexing a rank N array.

Returns:

rank 1 indeces.

See Also:

applyIndex(QDataSet, QDataSet) applyIndex, which does the same thing.

search for examples


subtract

subtract( QDataSet ds1, QDataSet ds2 ) → QDataSet

subtract one dataset from another.

Parameters:

ds1 - a rank N dataset
ds2 - a rank M dataset with compatible geometry

Returns:

the element-wise difference of the two datasets.

search for examples


synchronize

synchronize( QDataSet ds1, QDataSet ds ) → QDataSet

The first dataset's timetags are used to synchronize the second dataset to a set of common timetags. Presently, only interpolation is used, but other methods may be introduced soon. Note that when one of the dataset's DEPEND_0 is not monotonic, a monotonic subset of its points will be used. Ordinal units use the nearest neighbor interpolation.

Parameters:

ds1 - the dataset providing timetags, or the timetags themselves.
ds - the single datasets to synch up.

Returns:

the single dataset evaluated at the other dataset's timetags.

See Also:

synchronizeNN(QDataSet, QDataSet)
synchronize(QDataSet, QDataSet...)

search for examples


synchronize

synchronize( QDataSet dsTarget, QDataSet[] dsSources ) → java.util.List

The first dataset's timetags are used to synchronize the list of datasets to a set of common timetags. Presently, only interpolation is used, but other methods may be introduced soon. Note that when one of the dataset's DEPEND_0 is not monotonic, a monotonic subset of its points will be used. Ordinal units use the nearest neighbor interpolation.

Parameters:

dsTarget - the dataset providing timetags, or the timetags themselves.
dsSources - the N datasets to synch up.

Returns:

a list of N datasets, synchronized

See Also:

synchronizeNN(QDataSet, QDataSet...)
synchronize(QDataSet, QDataSet)

search for examples


synchronizeNN

synchronizeNN( QDataSet ds1, QDataSet ds ) → QDataSet

The first dataset's timetags are used to synchronize the second dataset to a set of common timetags, using nearest neighbor interpolation. Note that when one of the dataset's DEPEND_0 is not monotonic, a monotonic subset of its points will be used. Ordinal units use the nearest neighbor interpolation.

Parameters:

ds1 - the dataset providing timetags, or the timetags themselves.
ds - the single datasets to synch up.

Returns:

the single dataset evaluated at the other dataset's timetags.

See Also:

synchronize(QDataSet, QDataSet)
synchronizeNN(QDataSet, QDataSet...)

search for examples


synchronizeNN

synchronizeNN( QDataSet ds1, QDataSet[] dss ) → java.util.List

The first dataset's timetags are used to synchronize the list of datasets to a set of common timetags, using nearest neighbor interpolation. Note that when one of the dataset's DEPEND_0 is not monotonic, a monotonic subset of its points will be used.

Parameters:

ds1 - the dataset providing timetags, or the timetags themselves.
dss - the N datasets, each either rank 1 or rank 2.

Returns:

a list of N datasets, synchronized

See Also:

synchronize(QDataSet, QDataSet...)
synchronizeNN(QDataSet, QDataSet)

search for examples


synchronizeOne

synchronizeOne( QDataSet dsTarget, QDataSet dsSource ) → QDataSet

The first dataset's timetags are used to synchronize the single dataset to common timetags. Presently, data from dsSource will be interpolated to create data at dsTarget timetag locations, but other methods may be introduced soon. Ordinal units use the nearest neighbor interpolation.

Parameters:

dsTarget - the dataset providing timetags, or the timetags themselves.
dsSource - the dataset to synch up. Its timetags must be monotonically increasing and non-repeating.

Returns:

the one dataset, synchronized.

See Also:

synchronize(QDataSet, QDataSet...)

search for examples


taggen

taggen( double base, double dcadence, int len0, Units units ) → MutablePropertyDataSet

creates tags. First tag will be start and they will increase by cadence. Units specifies the units of each tag.

Parameters:

base -
dcadence -
len0 -
units -

Returns:

MutablePropertyDataSet

search for examples


tan

tan( QDataSet ds ) → QDataSet

element-wise tan.

Parameters:

ds -

Returns:

QDataSet

search for examples


tanh

tanh( QDataSet ds ) → QDataSet

element-wise tanh.

Parameters:

ds -

Returns:

QDataSet

search for examples


timegen

timegen( java.lang.String baseTime, java.lang.String cadence, int len0 ) → QDataSet

returns rank 1 dataset with values that are times.

Parameters:

baseTime - e.g. "2003-02-04T00:00"
cadence - e.g. "4.3 sec" "1 day"
len0 - the number of elements.

Returns:

QDataSet

search for examples


toDegrees

toDegrees( QDataSet ds ) → QDataSet

convert the data to degrees by multiplying each element by 180/PI. This does not check the units of the data, but a future version might.

Parameters:

ds -

Returns:

QDataSet

search for examples


toRadians

toRadians( QDataSet ds ) → QDataSet

convert the data to radians by multiplying each element by PI/180. This does not check the units of the data, but a future version might.

Parameters:

ds -

Returns:

QDataSet

search for examples


toTimeDataSet

toTimeDataSet( QDataSet years, QDataSet mons, QDataSet days, QDataSet hour, QDataSet minute, QDataSet second, QDataSet nano ) → QDataSet

return a rank 1 dataset of times. All inputs should be rank 1 dataset (for now) or null.

Parameters:

years - the years. (2010) Less than 100 is interpreted as 19xx.
mons - the months (1..12), or null. If null, then days are day of year. These are interpreted as integers
days - the day of month (1..28) or day of year. This may be fractional.
hour - null or the hours of the day.
minute - null or the minutes of the day
second - null or the seconds of the day
nano - null or the nanoseconds (1e-9) of the day

Returns:

rank 1 time data set.

search for examples


total

total( QDataSet ds ) → double

return the total of all the elements in the dataset. If there are invalid measurements, then fill is returned. Does not support BINS or BUNDLE dimensions.

Parameters:

ds -

Returns:

the unweighted total of the dataset, or -1e31 if fill was encountered.

See Also:

total(QDataSet, int) total, which should be used instead.

search for examples


total

total( QDataSet ds, ProgressMonitor mon ) → double

return the total of all the elements in the dataset. If there are invalid measurements, then fill is returned. Does not support BINS or BUNDLE dimensions.

Parameters:

ds -
mon - progress monitor

Returns:

the unweighted total of the dataset, or -1e31 if fill was encountered.

See Also:

total(QDataSet, int, org.das2.util.monitor.ProgressMonitor) total, which should be used instead.

search for examples


total

total( QDataSet ds, int dim ) → QDataSet

reduce the dataset's rank by totaling all the elements along a dimension. Only QUBEs are supported presently.

Parameters:

ds - rank N qube dataset. N=1,2,3,4
dim - zero-based index number.

Returns:

rank N-1 dataset.

See Also:

total(QDataSet) total(ds) total, which is an earlier deprecated routine.
reduceSum(QDataSet, int) reduceSum, which skips invalid data.

search for examples


total

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

reduce the dataset's rank by totaling all the elements along a dimension. Only QUBEs are supported presently.

Parameters:

ds - rank N qube dataset. N=1,2,3,4
dim - zero-based index number.
mon - progress monitor.

Returns:

the rank N-1 qube dataset.

search for examples


transpose

transpose( QDataSet ds ) → QDataSet

transpose the rank 2 dataset. result[i,j]= ds[j,i] for each i,j.

Parameters:

ds - rank 2 dataset

Returns:

rank 2 dataset

search for examples


trim

trim( QDataSet ds, int st, int en ) → QDataSet

trim the dataset to the indeces on the zeroth dimension. Note the trim function can also be called directly.

Parameters:

ds - the dataset to be trimmed.
st - the start index
en - the non-inclusive end index

Returns:

QDataSet

search for examples


trim

trim( QDataSet ds, DatumRange dr ) → QDataSet

return the trim of the dataset ds where its DEPEND_0 (typically xtags) are within the range dr.

Parameters:

ds - a rank 1 or greater dataset
dr - a range in the same units as ds

Returns:

the subset of the data.

See Also:

trim(QDataSet, QDataSet, QDataSet)

search for examples


trim

trim( QDataSet ds, Object odr ) → QDataSet

return the trim of the dataset ds where its DEPEND_0 (typically xtags) are within the range dr.

Parameters:

ds - a rank 1 or greater dataset
odr - an object which can be interpretted as a range.

Returns:

the subset of the data.

See Also:

trim(QDataSet, QDataSet, QDataSet)

search for examples


trim

trim( QDataSet ds, QDataSet st, QDataSet en ) → QDataSet

return the trim of the dataset ds where its DEPEND_0 (typically xtags) are within the range dr. For example, if ds was 7-days from 2014-01-01 through 2014-01-07, and st=2014-01-02 and en=2014-01-03 then just the records collected on this one day would be returned.

Parameters:

ds - the dataset to be trimmed, with a rank 1 monotonic DEPEND_0.
st - rank 0 min value
en - rank 0 max value

Returns:

the subset of the data.

See Also:

slice0(QDataSet, QDataSet)

search for examples


trim

trim( int dim, QDataSet ds, int st, int en ) → QDataSet

trim the qube dataset on any of its indices, for example ds[:,:,5:10] would use this operation.

Parameters:

dim - the index (0, 1, 2, 3, or 4) on which to trim.
ds - the dataset, which must be a qube.
st - the first index, inclusive
en - the last index, exclusive

Returns:

the trimmed dataset with same number of dimensions and fewer indeces in one dimension.

search for examples


trim

trim( int dim, QDataSet ds, QDataSet st, QDataSet en ) → QDataSet

trim the qube dataset on any of its indices, for example ds[:,:,5:10] would use this operation.

Parameters:

dim - the index (0, 1, 2, 3, or 4) on which to trim.
ds - the dataset, which must be a qube.
st - rank 0 min value
en - rank 0 max value

Returns:

the trimmed dataset with same number of dimensions and fewer indeces in one dimension.

search for examples


trim1

trim1( QDataSet ds, QDataSet st, QDataSet en ) → QDataSet

return the trim of the dataset ds where its DEPEND_1 (typically ytags) are within the range dr. For example, if ds was frequencies from 10 Hz to 1e8 Hz, trim1( ds, 100Hz, 1000Hz ) would return just the data in this range.

Parameters:

ds - the dataset to be trimmed, with a rank 1 monotonic DEPEND_1.
st - rank 0 min value
en - rank 0 max value

Returns:

the subset of the data.

See Also:

slice1(QDataSet, QDataSet)

search for examples


trim1

trim1( QDataSet ds, int st, int en ) → QDataSet

trim on the first (not zeroth) dimension. This is to help with unbundling the timeranges from an events dataset.

Parameters:

ds - the dataset, rank 2 or greater
st - the first index
en - the last index, exclusive.

Returns:

the trimmed dataset.

search for examples


unbundle

unbundle( QDataSet ds, java.lang.String name ) → QDataSet

Extract the named bundled dataset. For example, extract B_x from bundle of components.

Parameters:

ds - the bundle of datasets, often rank 2 with BUNDLE_1 property
name - the name of the bundled dataset, or "ch_<i>" where i is the dataset number

Returns:

the named dataset

See Also:

unbundle(QDataSet, int)
DataSetOps#bundleNames(QDataSet)

search for examples


unbundle

unbundle( QDataSet ds, int i ) → QDataSet

Extract a bundled dataset from a bundle of datasets. The input should be a rank 2 dataset with the property BUNDLE_1 set to a bundle descriptor dataset. See BundleDataSet for more semantics. Note we support the case where DEPEND_1 has EnumerationUnits, and this is the same as slice1.

Parameters:

ds - the bundle dataset.
i - index of the dataset to extract. If the index is within a high-rank dataset, then the entire dataset is returned.

Returns:

the i-th dataset from the bundle.

search for examples


unbundleBins

unbundleBins( QDataSet ds, int i ) → QDataSet

convenient method for getting the times from an events dataset, this unbundles the startTimes at i and the stopTimes at i+1 to a bins dataset. The second column can be durations as well.

Parameters:

ds - the bundle.
i - the index, 0 for a canonical events dataset.

Returns:

rank 2 bins dataset.

search for examples


uniq

uniq( QDataSet ds ) → QDataSet

Return the unique indeces from the rank 1 dataset. If the set is not monotonic, then return unique indeces from the monotonic portions.

Parameters:

ds - rank 1 dataset, sorted, or mostly sorted.

Returns:

the element indeces.

See Also:

sort(java.lang.Object)
uniq(QDataSet, QDataSet)
uniqValues(QDataSet, QDataSet)

search for examples


uniq

uniq( QDataSet ds, QDataSet sort ) → QDataSet

Return the unique indeces from the rank 1 dataset, using sort to resort the indeces. If sort is null, then the dataset is assumed to be monotonic, and only repeating values are coalesced. If sort is non-null, then it is the result of the function "sort" and should be a rank 1 list of indeces that sort the data.

Parameters:

ds - rank 1 dataset, sorted, or mostly sorted.
sort - null, or the rank 1 dataset of indeces

Returns:

the indeces of the unique elements.

See Also:

uniqValues uniqValues, which returns the values. uniqValues, which returns the values.

search for examples


uniqValues

uniqValues( QDataSet ds, QDataSet sort ) → QDataSet

return the unique elements from the dataset. If sort is null, then the dataset is assumed to be monotonic, and only repeating values are coalesced. If sort is non-null, then it is the result of the function "sort" and should be a rank 1 list of indeces that sort the data.

renamed uniqValues from uniq to avoid confusion with the IDL command.

This needs example code and should not be used for now. See VirboAutoplot/src/scripts/test/testUniq.jy

Parameters:

ds - rank 1 dataset, sorted, or mostly sorted.
sort - null, or the rank 1 dataset of indeces

Returns:

the subset of the data which is uniq.

See Also:

uniq uniq, which returns the indeces. uniq, which returns the indeces.
uniq(QDataSet, QDataSet)

search for examples


unwrap

unwrap( QDataSet ds, double discont ) → QDataSet

SciPy's unwrap function, used in demo of hilbertSciPy, which unwraps a function that exists in a modulo space so that the differences are minimal.

Parameters:

ds - rank 1 dataset, containing values from 0 to discont
discont - the discont, such as PI, TAU, 24, 60, 360, etc.

Returns:

QDataSet

search for examples


valid

valid( QDataSet ds ) → QDataSet

returns a dataset with zero where the data is invalid, and positive non-zero where the data is valid. (This just returns the weights plane of the dataset.)

r= where( valid( ds ) )

Parameters:

ds - a rank N dataset that might have FILL_VALUE, VALID_MIN or VALID_MAX set.

Returns:

a rank N dataset with the same geometry, with zeros where the data is invalid and >0 where the data is valid.

search for examples


variance

variance( Object o ) → QDataSet

Parameters:

Returns:

QDataSet

search for examples


variance

variance( QDataSet ds ) → QDataSet

variance function is the square of the stddev.

Parameters:

ds - rank 1 dataset.

Returns:

Rank 0 QDataSet containing the variance. The result is currently dimensionless, but this will change.

See Also:

stddev

search for examples


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


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


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


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


zeros

zeros( int len0 ) → WritableDataSet

return new dataset filled with zeros.

Parameters:

len0 -

Returns:

WritableDataSet

See Also:

fltarr(int) fltarr, which stores the data in 4-byte floats.

search for examples


zeros

zeros( int len0, int len1 ) → WritableDataSet

return new dataset filled with zeros.

Parameters:

len0 -
len1 -

Returns:

WritableDataSet

search for examples


zeros

zeros( int len0, int len1, int len2 ) → WritableDataSet

return new dataset filled with zeros.

Parameters:

len0 -
len1 -
len2 -

Returns:

WritableDataSet

search for examples


zeros

zeros( QDataSet ds ) → WritableDataSet

return a new dataset filled with zeroes that has the same geometry as the given dataset. Only supports QUBE datasets.

Parameters:

ds -

Returns:

a new dataset with filled with zeroes with the same geometry.

search for examples

Table Of Contents

URIs that Point to Data Files

Download a CDF and Plot it with Autoplot

Load a CDF directly from a website

URIs that Point to Data Servers

Saving to vap files

Loading vap files

Data Sources

CDF Files

HDF/NetCDF Files

Aggregation

CDAWeb

HAPI Servers

Exporting Data

Export Types

Additional controls

Aggregation

Tools

PNGWalk Tool

Data Mash Up

Events List

Run Batch

Advanced Topics

TimeSeriesBrowse and other Capabilities

Events Lists

Caching

Autoranging

Managing Autoplot's Data Cache

Using Autoplot with Python, IDL, and Matlab

Reading data into Python

Reading data into IDL

Reading data into Matlab

QDataSet Data Model

Clone this wiki locally