## identifyContinuousBlocks

identifyContinuousBlocks( Datum cadence, DatumRange extent, QDataSet lastBlocks, QDataSet times ) → QDataSet

return events list containing start and stop times of continuous blocks in time. The parameter lastBlocks allows serial processing of data, so that intervals spanning extent boundaries will be correctly identified, once. If the last timetag of times is within the cadence of the stop of the extent, then this block will be dropped, but its start is noted in the property "partialBlockStart." If first timetag is within cadence of the start, then the last block of lastTimes will be added. Note the labels for each interval are the indices of the first and last (exclusive) continuous segment.

### Parameters

cadence - null or the cadence
extent - null or the interval containing the times.
lastBlocks - null or the preceding interval times.
times - the times for the interval

### Returns:

an events list containing the start and stop times.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## 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] [view on GitHub] [view on old javadoc] [view source]

## 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 - a QDataSet
stepFraction - an int
mon - a ProgressMonitor

### Returns:

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

## 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] [view on GitHub] [view on old javadoc] [view source]
imax( Object ds ) → int [view source]

## 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] [view on GitHub] [view on old javadoc] [view source]
imin( Object ds ) → int [view source]

## 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 - an int

### Returns:

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

## indgen

indgen( int len0, int len1 ) → QDataSet

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

### Parameters

len0 - an int
len1 - an int

### Returns:

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

## indgen

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

returns rank 3 dataset with values increasing

### Parameters

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

### Returns:

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

## 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] [view on GitHub] [view on old javadoc] [view source]

## 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] [view on GitHub] [view on old javadoc] [view source]

## 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] [view on GitHub] [view on old javadoc] [view source]

## interpolate

interpolate( QDataSet vv, QDataSet findex ) → QDataSet

interpolate values from rank 1 dataset vv using fractional indices in rank N findex. For example, findex=1.5 means interpolate the 1st and 2nd indices 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:

    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 )

This looks at the AVERAGE_TYPE metadata, and when it is present, linear, geometric, none, mod360, mod24, modpi, and modtau are respected.

### Parameters

vv - rank 1 dataset having length L that is the data to be interpolated.
findex - rank N dataset of fractional indices. 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
[search for examples] [view on GitHub] [view on old javadoc] [view source]
interpolate( Object vv, Object findex ) → QDataSet [view source]

## interpolate

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

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

### Parameters

vv - rank 2 dataset.
findex0 - rank N dataset of fractional indices 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 indices 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
interpolateGrid(QDataSet, QDataSet, QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## interpolate

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

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

### Parameters

vv - object convertible to rank 2 dataset.
findex0 - object convertible to rank N dataset of fractional indices for the zeroth index.
findex1 - object convertible to rank N dataset of fractional indices for the first index.

### Returns:

rank N dataset

### See Also:

findex findex, the 1-D findex command
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## interpolate

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

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

### Parameters

vv - rank 2 dataset.
findex0 - rank N dataset of fractional indices 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 indices 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 indices 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
interpolateGrid
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## interpolateGrid

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

interpolate values from rank 2 dataset vv using fractional indices 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 indices for the zeroth index.
findex1 - rank 1 dataset of fractional indices for the first index.

### Returns:

rank 2 dataset

### See Also:

findex findex, the 1-D findex command
[search for examples] [view on GitHub] [view on old javadoc] [view source]
interpolateGrid( Object x, Object y, Object z ) → QDataSet [view source]

## 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 indices. 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] [view on GitHub] [view on old javadoc] [view source]

## invalid

invalid( QDataSet ds ) → QDataSet

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

>     r= where( invalid( ds ) )

The purpose of this is to make this commonly used logic easier to find.

### Parameters

ds - a rank N dataset

### Returns:

a rank N dataset

### See Also:

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

## irange

irange( double min, double max, int step ) → java.util.Iterator

mimic the Jython xrange function for use in loops. The returns the integers in the sequence, like xrange, but avoids the confusing "xrange" name and this also takes double values so that it can be used in graphics routines which use double.

### Parameters

min - the first value
max - the last value, plus one (exclusive).
step - the increment between elements.

### Returns:

an iterator for the numbers in the interval.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## irange

irange( double min, double max ) → java.util.Iterator

mimic the Jython xrange function for use in loops. This creates an dataset which has no storage.

### Parameters

min - the first value
max - the last value, plus one (exclusive).

### Returns:

an iterator for the numbers in the interval.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## irange

irange( double max ) → java.util.Iterator

mimic the Jython xrange function for use in loops. This creates an dataset which has no storage.

### Parameters

max - the last value, plus one (exclusive).

### Returns:

an iterator for the numbers in the interval.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isAngleRange

isAngleRange( QDataSet ds, boolean strict ) → 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] [view on GitHub] [view on old javadoc] [view source]

## isBundle

isBundle( QDataSet zds ) → boolean

return true if the dataset is a bundle. It is rank 2 or rank 1 or rank 3, 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] [view on GitHub] [view on old javadoc] [view source]

## 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] [view on GitHub] [view on old javadoc] [view source]

## isSafeName

isSafeName( 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 - a String

### Returns:

true if the name is a safe identifier name.
[search for examples] [view on GitHub] [view on old javadoc] [view source]