## org.das2.qds.util.LSpec

Form a rank 2 dataset with L and Time for tags by identifying monotonic sweeps in two rank 1 datasets, and interpolating along the sweep.

## USER_PROP_SWEEPS

identifies the sweep of each record

## DIR_INWARD

just the inward sweeps

## DIR_OUTWARD

just the outward sweeps

## DIR_BOTH

include both sweeps

## identifySweeps

identifySweeps( QDataSet lds, int dir ) → QDataSet

identify monotonically increasing or decreasing segments of the dataset.

### Parameters

lds - the dataset which sweeps back and forth, such as LShell or MagLat (or a sine wave for testing).
dir - 0=both 1=outward 2= inward

### Returns:

rank 2 data set of sweep indeces, dim0 is sweep number, dim1 is two-element [ start, end(inclusive) ].
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## rebin

rebin( QDataSet lds, QDataSet zds, QDataSet lgrid ) → QDataSet

rebin the datasets to rank 2 dataset ( time, LShell ), by interpolating along sweeps. This dataset has the property "sweeps", which is a dataset that indexes the input datasets.

### Parameters

lds - rank 1 dataset of length N
zds - rank 1 dataset of length N, indexed along with {@code lds}
lgrid - rank 1 dataset indicating the dim 1 tags for the result dataset.

### Returns:

a rank 2 dataset, with one column per sweep, interpolated to {@code lgrid}
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## rebin

rebin( QDataSet tlz, QDataSet lgrid, int dir ) → QDataSet

alternate, convenient interface which where tlz is a bundle of buckshot data (T,L,Z)

### Parameters

tlz - x,y,z (T,L,Z) bundle of Z values collected along inward and outward sweeps of L in time.
lgrid - desired uniform grid of L values.
dir - =1 increasing (outward) only, =-1 decreasing (inward) only, 0 both.

### Returns:

a rank 2 dataset, with one column per sweep, interpolated to {@code lgrid}
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## rebin

rebin( QDataSet tt, QDataSet lds, QDataSet zds, QDataSet tspace, QDataSet lgrid, int dir ) → QDataSet

alternate algorithm following Brian Larson's algorithm that rebin the datasets to rank 2 dataset ( time, LShell ), by interpolating along sweeps. This dataset has the property "sweeps", which is a dataset that indexes the input datasets.

### Parameters

tt - The Time values corresponding to x axis position. If null, then use lds.property(QDataSet.DEPEND_0).
lds - The L values corresponding to y axis position, which should be a function of time.
zds - the Z values corresponding to the parameter we wish to organize
tspace - rank 0 cadence, such as dataset('9 hr')
lgrid - rank 1 data is the grid points, such as linspace( 2.,8.,30 )
dir - =1 increasing (outward) only, =-1 decreasing (inward) only, 0 both

### Returns:

a rank 2 dataset, with one column per sweep, interpolated to {@code lgrid}
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## rebin

rebin( QDataSet lds, QDataSet zds, QDataSet lgrid, int dir ) → QDataSet

rebin the datasets to rank 2 dataset ( time, LShell ), by interpolating along sweeps. This dataset has the property "sweeps", which is a dataset that indexes the input datasets.

### Parameters

lds - rank 1 dataset of length N
zds - rank 1 dataset of length N, indexed along with {@code lds}
lgrid - rank 1 dataset indicating the dim 1 tags for the result dataset.
dir - =1 increasing (outward) only, =-1 decreasing (inward) only, 0 both

### Returns:

a rank 2 dataset, with one column per sweep, interpolated to {@code lgrid}
[search for examples] [view on GitHub] [view on old javadoc] [view source]