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

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

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

## fftLinearSpectralDensity

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

Perform the linear spectral density function

### Parameters

ds - waveform data
window - the window to apply window to apply
stepFraction - advance by this much for each window (2 means 50% overlap, 4 means 75% overlap, etc.)
mon - progress monitor

### Returns:

the linear spectral density

### See Also:

https://holometer.fnal.gov/GH_FFT.pdf page 7
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fftLinearSpectrum

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

Perform the linear spectrum function

### Parameters

ds - waveform data
window - the window to apply window to apply
stepFraction - advance by this much for each window (2 means 50% overlap, 4 means 75% overlap, etc.)
mon - progress monitor

### Returns:

the linear spectral density

### See Also:

https://holometer.fnal.gov/GH_FFT.pdf page 7
[search for examples] [view on GitHub] [view on old javadoc] [view source]

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

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

## fftPower

fftPower( QDataSet ds, int windowLen, int stepFraction, 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] [view on GitHub] [view on old javadoc] [view source]

## 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. Normalization is done with non-unity windows. (See https://github.com/autoplot/dev/bugs/sf/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.

### See Also:

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

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

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

## fftPowerSpectralDensity

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

Perform the power spectral density function

### Parameters

ds - waveform data
window - the window to apply
stepFraction - advance by this much for each window (2 means 50% overlap, 4 means 75% overlap, etc.)
mon - a progress monitor

### Returns:

the power spectral density

### See Also:

https://holometer.fnal.gov/GH_FFT.pdf page 7
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fftPowerSpectrum

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

Perform the linear spectrum function

### Parameters

ds - waveform data
window - the window to apply window to apply
stepFraction - advance by this much for each window (2 means 50% overlap, 4 means 75% overlap, etc.)
mon - progress monitor

### Returns:

the linear spectral density

### See Also:

https://holometer.fnal.gov/GH_FFT.pdf page 7
[search for examples] [view on GitHub] [view on old javadoc] [view source]

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

## fillIsDifferent

fillIsDifferent( QDataSet ds1, QDataSet ds2 ) → boolean

return true of the representation of fill is different in the two data sets. TODO: this does not consider WEIGHTS.

### Parameters

ds1 - a QDataSet
ds2 - a QDataSet

### Returns:

true of the representation of fill is different in the two data sets.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## 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] [view on GitHub] [view on old javadoc] [view source]
findex( Object x, Object y ) → QDataSet [view source]

## findgen

findgen( int len0 ) → QDataSet

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

### Parameters

len0 - an int

### Returns:

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

## findgen

findgen( 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]

## findgen

findgen( 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]

## findgen

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

returns rank 4 dataset with values increasing

### Parameters

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

### Returns:

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

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

## flatten

flatten( QDataSet ds ) → QDataSet

flatten a rank N dataset. 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 indices will be the independent variables sorted by dimension.

### Parameters

ds - the rank N dataset

### Returns:

rank 2 dataset bundle

### See Also:

org.das2.qds.DataSetOps#flattenRank2(QDataSet)
grid(QDataSet)
flattenWaveform(QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

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

## floor

floor( QDataSet ds1 ) → QDataSet

element-wise floor function.

### Parameters

ds1 - a QDataSet

### Returns:

a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]
floor( double x ) → double [view source]
floor( Object ds1 ) → QDataSet [view source]

## 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)
strarr(int)
[search for examples] [view on GitHub] [view on old javadoc] [view source]
fltarr( int len0, int len1 ) → QDataSet [view source]
fltarr( int len0, int len1, int len2 ) → QDataSet [view source]