org.das2.qds.examples.Schemes
For the various QDataSet schemes, show examples and documentation for
each. This was motivated when trying to describe the output of
org.das2.graph.ContoursRenderer.doAutorange()
Note all QDataSets are "duck-typed," meaning if they happen to meet the
requirements of an interface then they are an instance of the interface.
All schemes can be executed using reflection, looking for methods starting
with "is". This Jython code scans through the class looking for all the
methods which make a dataset:
{@code
mm= dir( Schemes )
i=0
for m in mm:
if ( m[0:2]=='is' ):
continue
else:
i=i+1
}
Schemes( )
angleDistribution
angleDistribution( ) → QDataSet
return example angle distribution.
Returns:
example angle distribution.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
angleDistribution( int i ) → QDataSet
arrayOfBoundingBox
arrayOfBoundingBox( ) → QDataSet
array of bounding boxes, joined by the zeroth dimension.
Returns:
array of bounding boxes
See Also:
boundingBox()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
boundingBox
boundingBox( ) → QDataSet
return a bounding box for the data. This is a rank 2 dataset where
ds[0,:] shows the bounds for the first dimension and ds[1,:] shows the
bounds for the second dimension. Therefor ds[0,0] is the minumum extent
of the first dimension, and ds[0,1] is the maximum.
Note this can be extended to any number
of dimensions (cube or hypercube).
Note,
from org.das2.qds.examples import Schemes
ds= Schemes.boundingBox()
print asDatumRange(ds.slice(0))
Returns:
a bounding box for the data.
See Also:
org.das2.qds.DataSetUtil#asDatumRange(QDataSet)
arrayOfBoundingBox()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
bundleDataSet
bundleDataSet( ) → QDataSet
return an example bundle dataset that bundles timetags, a rank 1 dataset
and a rank 1 dataset.
Returns:
an example bundle dataset
See Also:
complexBundleDataSet() which has differing rank.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
bundleDescriptor
bundleDescriptor( ) → QDataSet
return data that describes the columns of another dataset. Note these
are typically not found in APIs. The bundle descriptor will be
- rank 2,
- length() gives the number of columns.
- length(i) gives the number of indices of the ith column, or the ith column's rank.
- property(i,NAME) gives the name of the column
- property(i,START_INDEX) gives the column which is the first column of the rank 2 or higher bundled data set.
- property(i,xxx) gives property xxx of the column
- property(i,DEPEND0_NAME) gives the name of the column containing the depend 0 values.
Returns:
data that describes the columns of another dataset.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
complexBundleDataSet
complexBundleDataSet( ) → QDataSet
return bundle with Time, Density, Speed, and Flux, to demonstrate
a bundle of datasets with differing rank.
Returns:
bundle with Time, Density, Speed, and Flux
See Also:
complexBundleDataSet2()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
complexBundleDataSet2
complexBundleDataSet2( ) → QDataSet
A complexBundleDataSet is a set of datasets which have different rank. The
rank 2 datasets take multiple columns of the dataset, and rank 3 and 4 datasets
are unrolled to make them rank 2 and the property ELEMENT_DIMENSIONS is used
to re-form them. This returns an example bundle dataset that bundles timetags, density, velocity, and flux.
Yes, this was coded this twice, not realizing it was already done. This code
is probably easier to read, so it is left in.
Returns:
an example bundle dataset
See Also:
complexBundleDataSet()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
complexCoordinateSystemDepend
complexCoordinateSystemDepend( ) → QDataSet
returns the QDataSet used to identify the columns of a complex coordinate frame.
Returns:
the QDataSet used to identify the columns of a complex coordinate frame.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
compositeImage
compositeImage( ) → QDataSet
return an example of a compositeImage.
Returns:
image[320,240,3]
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
eventsList
eventsList( ) → QDataSet
return example events list. This is a four-column rank 2 dataset with
start time, end time, RGB color, and ordinal data for the message.
Returns:
example events list.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
irregularJoin
irregularJoin( ) → QDataSet
return a rank 3 irregular join of three datasets,
the first is 13 records of 27 energies,
the second is 13 records of 20 energies, and
the third is 14 records of 24 energies.
Returns:
a rank 3 irregular join.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isAngleDistribution
isAngleDistribution( QDataSet ds ) → boolean
return true if the data is an angle distribution.
Parameters
ds - a dataset
Returns:
true if the data is an angle distribution.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isArrayOfBoundingBox
isArrayOfBoundingBox( QDataSet ds ) → boolean
return true if the data is a rank 3 array of bounding boxes. Presently only
2-D bounding boxes are allowed. The zeroth dimension is the number of boxes,
and each slice is a bounding box.
Parameters
ds - a QDataSet
Returns:
true if the data is a rank 3 array of bounding boxes.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isBoundingBox
isBoundingBox( QDataSet ds ) → boolean
return true if the data is a boundingBox. A bounding box is
rank 2 and has length 2. ds[0,:] is typically the horizontal
direction, and ds[1,:] is the vertical.
Parameters
ds - a dataset
Returns:
true if the dataset is a bounding box.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isBundleDataSet
isBundleDataSet( QDataSet ds ) → boolean
return true if the data is a bundle dataset
Parameters
ds - a dataset
Returns:
true if the data is a bundle dataset
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isBundleDescriptor
isBundleDescriptor( QDataSet bds ) → boolean
return true if the data describes the columns of another dataset.
Parameters
bds - a QDataSet
Returns:
a boolean
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isComplexCoordinateSystemDepend
isComplexCoordinateSystemDepend( QDataSet dep ) → boolean
return true if the data is length 2, rank 1, and has "ComplexNumber" as the COORDINATE_FRAME.
Parameters
dep - a QDataSet
Returns:
a boolean
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isComplexNumbers
isComplexNumbers( QDataSet ds1 ) → boolean
return true if the data represents an array of complex numbers, containing the property COORDINATE_FRAME
on the last DEPEND, which is equal to "ComplexNumber"
Parameters
ds1 - a dataset
Returns:
true if the data represents an array of complex numbers.
See Also:
Ops#checkComplexArgument(QDataSet)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isCompositeImage
isCompositeImage( QDataSet ds ) → boolean
return true if the dataset is a composite image, and is plottable
with the RGBImageRenderer
Parameters
ds - a dataset
Returns:
true if the dataset is a composite image.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isEventsList
isEventsList( QDataSet ds ) → boolean
return true if the data is an events list.
Parameters
ds - a dataset
Returns:
true if the data is an events list.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isIrregularJoin
isIrregularJoin( QDataSet ds ) → boolean
return true if the data is a join of datasets of different cadences or lengths.
Parameters
ds - a QDataSet
Returns:
return true if the data is a join of datasets of different cadences or lengths.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isLegacyXYZScatter
isLegacyXYZScatter( QDataSet zds ) → boolean
Many of Autoplot's codes use the "legacyXYZScatter" QDataSet scheme,
where the X tags are in DEPEND_0, the Y tags are the QDataSet, and
PLANE_0 contains the Z values.
Parameters
zds - a QDataSet
Returns:
a boolean
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isPolyMesh
isPolyMesh( QDataSet ds ) → boolean
return true if the data can be used as a triangulation or tessalation
of 4-point rectangles.
Parameters
ds - a QDataSet
Returns:
a boolean
See Also:
Ops#polyCenters(QDataSet)
https://sourceforge.net/p/autoplot/feature-requests/819/
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isRank1AlongTrajectory
isRank1AlongTrajectory( QDataSet ds ) → boolean
return true if the data is rank 1 along a trajectory
Parameters
ds - a dataset
Returns:
true if the data is rank 1 along a trajectory
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isRank1AtXYScatter
isRank1AtXYScatter( QDataSet ds ) → boolean
is a Z that is a function of X and Y of a xyScatter.
Parameters
ds - a QDataSet
Returns:
true if is a Z that is a function of X and Y of a xyScatter.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isRank2Bins
isRank2Bins( QDataSet dep ) → boolean
return true if the data is a rank 2 list of M bins. The data
will have rank=2 and the property BINS_1='min,max'
Parameters
dep - a QDataSet
Returns:
true if the data is a rank 2 list of M bins
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isRank2Waveform
isRank2Waveform( QDataSet ds ) → boolean
return true if the data is a rank 2 waveform.
Parameters
ds - a dataset
Returns:
true if the data is a rank 2 waveform.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isRank2WaveformRank2Offsets
isRank2WaveformRank2Offsets( QDataSet ds ) → boolean
return true if the data is a rank 2 waveform with rank 2 offsets.
Parameters
ds - a dataset
Returns:
true if the data is a rank 2 waveform.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isRank3Waveform
isRank3Waveform( QDataSet ds ) → boolean
return true if the data is a rank 3 join of rank 2 waveforms.
Parameters
ds - a dataset
Returns:
true if the data is a rank 3 waveform.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isScalarSeriesWithErrors
isScalarSeriesWithErrors( QDataSet ds ) → boolean
return true is the data is a simple series of scalars with errors.
Parameters
ds - dataset
Returns:
true is the data is a simple series of scalars with errors.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isScalarTimeSeries
isScalarTimeSeries( QDataSet ds ) → boolean
return true if the data is a simple time series of scalars.
Parameters
ds - a dataset
Returns:
true if the data is a simple spectrogram.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isSimpleSpectrogram
isSimpleSpectrogram( QDataSet ds ) → boolean
return true if the data is a simple spectrogram, which is
rank 2, and not a small bundle.
Parameters
ds - a dataset
Returns:
true if the data is a simple spectrogram.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isSimpleSpectrogramTimeSeries
isSimpleSpectrogramTimeSeries( QDataSet ds ) → boolean
return true if the data is a simple spectrogram.
Parameters
ds - a dataset
Returns:
true if the data is a simple spectrogram.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isTimeSeries
isTimeSeries( QDataSet ds ) → boolean
returns true if the dataset is a time series. This is either something
that has DEPEND_0 as a dataset with time location units, or a join of
other datasets that are time series.
Parameters
ds - a dataset
Returns:
true if the dataset is a time series.
See Also:
SemanticOps#isTimeSeries(QDataSet)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isTrajectory
isTrajectory( QDataSet ds ) → boolean
return true is the data is a trajectory
Parameters
ds - a dataset
Returns:
true if the data is a trajectory
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isUniformCadence
isUniformCadence( QDataSet ds ) → boolean
return true of the data has a uniform cadence. Note that
the CADENCE property is ignored.
Parameters
ds - a rank 1 dataset
Returns:
true if the data has uniform cadence.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isUniformRatiometricCadence
isUniformRatiometricCadence( QDataSet ds ) → boolean
return true of the data has a uniform cadence in log space. Note that
the CADENCE property is ignored.
Parameters
ds - a rank 1 dataset
Returns:
true if the data has uniform cadence.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isVectorTimeSeries
isVectorTimeSeries( QDataSet ds ) → boolean
return true if the data is a vector time series.
Parameters
ds - a dataset
Returns:
true if the data is a vector time series.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isXYScatter
isXYScatter( QDataSet ds ) → boolean
is a xyScatter data set.
Parameters
ds - a QDataSet
Returns:
true if is a xyScatter data set.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isXYZScatter
isXYZScatter( QDataSet zds ) → boolean
Parameters
zds - a QDataSet
Returns:
true is it is an xyzScatter scheme.
See Also:
xyzScatter()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
legacyXYZScatter
legacyXYZScatter( ) → QDataSet
Many code use this form of data to represent Z(X,Y). This is not preferred,
and ds[n;x,y,z] should be used instead. This is available for testing.
Returns:
rank 1 dataset with DEPEND_0 and PLANE_0 properties.
See Also:
rank1AtXYScatter
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
polyMesh
polyMesh( ) → QDataSet
set of 2-d or 3-d points and the triangles connecting them. Note that
Ops.triangulate does not return this schema. This is introduced to
experiment with an oddly-structured dataset. For example, this can
be a DEPEND_0 of a rank 1 rgb color dataset.
Returns:
a triangular mesh.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank1AlongTrajectory
rank1AlongTrajectory( ) → QDataSet
return a rank 1 dataset that depends on a trajectory through a space,
which is not supported currently.
Returns:
rank 1 dataset with DEPEND_0 a trajectory.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank1AtXYScatter
rank1AtXYScatter( ) → QDataSet
Here there is a Z that is a function of X and Y of a xyScatter.
Returns:
rank 1 dataset that has bundle for DEPEND_0.
See Also:
xyzScatter()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank2Bins
rank2Bins( ) → QDataSet
return a rank 2 dataset that is a list of bins.
Returns:
a QDataSet
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank2ComplexNumbers
rank2ComplexNumbers( ) → QDataSet
return a complex rank 2 dataset, N by 2, which can be thought of as a 1-D array of N complex numbers
Returns:
a complex rank 2 dataset ds[N,2]
See Also:
isComplexNumbers(QDataSet)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank2Waveform
rank2Waveform( ) → QDataSet
return a rank 2 waveform, where the waveform is stored in packets.
DEPEND_0 is the time for each packet, and DEPEND_1 is the difference in
time for each measurement to the packet time. Note the additional requirement
that the offsets be uniform, e.g.:
from org.das2.qds.examples import Schemes
ds= Schemes.rank2Waveform()
deltaT= ds.property( QDataSet.DEPEND_1 )
ddeltaT= diffs(dep1)
print ddeltaT[0], ddeltT[-1] # should be the same
Returns:
rank 2 waveform.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank2WaveformRank2Offsets
rank2WaveformRank2Offsets( ) → QDataSet
return a rank 2 waveform, but DEPEND_1 which contains the offsets is also
rank 2. This was introduced to support study where short waveform-like
structures were identified.
Returns:
a rank 2 waveform, but with rank 2 time-varying DEPEND_1 offsets.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank3Waveform
rank3Waveform( ) → QDataSet
return a join of rank 2 waveforms, also called a rank 3 waveform.
Returns:
rank 3 waveform
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
scalarSeriesWithErrors
scalarSeriesWithErrors( ) → QDataSet
return a rank 1 scalar series with errors.
Returns:
a rank 1 scalar series with errors.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
scalarTimeSeries
scalarTimeSeries( ) → QDataSet
return a rank 1 scalar time series.
Returns:
a rank 1 scalar time series.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
simpleSpectrogram
simpleSpectrogram( ) → QDataSet
return a rank 2 simple spectrogram, which has two indeces.
Returns:
rank 2 simple spectrogram
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
simpleSpectrogramTimeSeries
simpleSpectrogramTimeSeries( ) → QDataSet
return a rank 2 simple spectrogram, which has two indeces
and is a TimeSeries.
Returns:
simple spectrogram time series
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
trajectory
trajectory( ) → QDataSet
return a trajectory through a space
Returns:
rank 2 dataset
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
uniformCadence
uniformCadence( ) → QDataSet
uniform cadence is when each tag is the same distance apart, within a reasonable threshold.
Returns:
dataset with uniform cadence
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
uniformRatiometricCadence
uniformRatiometricCadence( ) → QDataSet
uniform ratiometric cadence is when the tags are uniform in log space.
Returns:
dataset with uniform ratiometric cadence.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
vectorTimeSeries
vectorTimeSeries( ) → QDataSet
return a rank 2 vectorTimeSeries, which is a bundle
of m rank 1 measurements. This tacitly asserts orthogonality,
but the bundled data should at least all be rank 1 and in the same units.
from org.das2.qds.examples import Schemes
ds= Schemes.vectorTimeSeries()
plot( magnitude( ds ) )
plot( unbundle( ds, 0 ) )
dataset→rank2bundle→vectorTimeSeries.
Returns:
rank 2 vector time series.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
xyScatter
xyScatter( ) → QDataSet
"scatter" is meant to indicate there is no connection between
successive points, and that there is no dependence indicates no
clean relation between the bundled datasets.
Returns:
a QDataSet
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
xyzScatter
xyzScatter( ) → QDataSet
This will be the preferred way to represent X,Y → Z. This shows
a problem, however, where there is no way to indicate the dependencies
for the columns. The Z column can have DEPENDNAME_0, but how does one
declare the dependence on Y as well?
In https://sourceforge.net/p/autoplot/bugs/1710/, I propose
CONTEXT_0=field0,field2, which seems like it would work nicely.
Returns:
a QDataSet
See Also:
rank1AlongTrajectory()
rank1AtXYScatter()
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]