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.
angleDistribution
angleDistribution( ) → QDataSet
return example angle distribution.
Returns:
example angle distribution.
search for examples
view on GitHub
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)
search for examples
view on GitHub
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 source
bundleDescriptor
bundleDescriptor( ) → QDataSet
return data that describes the columns of another dataset. Note these
are typically not found in APIs.
Returns:
data that describes the columns of another dataset.
search for examples
view on GitHub
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 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 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 source
compositeImage
compositeImage( ) → QDataSet
return an example of a compositeImage.
Returns:
image[320,240,3]
search for examples
view on GitHub
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 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 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 source
isBoundingBox
isBoundingBox( QDataSet ds ) → boolean
return true if the data is a boundingBox.
Parameters
ds - a dataset
Returns:
true if the dataset is a bounding box.
search for examples
view on GitHub
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 source
isBundleDescriptor
isBundleDescriptor( QDataSet bds ) → boolean
return true if the data describes the columns of another dataset.
Parameters
bds -
Returns:
boolean
search for examples
view on GitHub
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 -
Returns:
boolean
search for examples
view on GitHub
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 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 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 source
isIrregularJoin
isIrregularJoin( QDataSet ds ) → boolean
return true if the data is a join of datasets of different cadences or lengths.
Parameters
ds -
Returns:
return true if the data is a join of datasets of different cadences or lengths.
search for examples
view on GitHub
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 -
Returns:
boolean
search for examples
view on GitHub
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 source
isRank1AtXYScatter
isRank1AtXYScatter( QDataSet ds ) → boolean
is a Z that is a function of X and Y of a xyScatter.
Parameters
ds -
Returns:
true if is a Z that is a function of X and Y of a xyScatter.
search for examples
view on GitHub
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 -
Returns:
true if the data is a rank 2 list of M bins
search for examples
view on GitHub
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 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 source
isScalarTimeSeries
isScalarTimeSeries( 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 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 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 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 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 source
isUniformRatiometricCadence
isUniformRatiometricCadence( 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 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 source
isXYScatter
isXYScatter( QDataSet ds ) → boolean
is a xyScatter data set.
Parameters
ds -
Returns:
true if is a xyScatter data set.
search for examples
view on GitHub
view source
isXYZScatter
isXYZScatter( QDataSet zds ) → boolean
Parameters
zds -
Returns:
true is it is an xyzScatter scheme.
See Also:
xyzScatter()
search for examples
view on GitHub
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 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 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 source
rank2Bins
rank2Bins( ) → QDataSet
return a rank 2 dataset that is a list of bins.
Returns:
org.das2.qds.QDataSet
search for examples
view on GitHub
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 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 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 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 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 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 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 source
trajectory
trajectory( ) → QDataSet
return a trajectory through a space
Returns:
rank 2 dataset
search for examples
view on GitHub
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 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 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 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:
org.das2.qds.QDataSet
search for examples
view on GitHub
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:
org.das2.qds.QDataSet
See Also:
rank1AlongTrajectory()
rank1AtXYScatter()
search for examples
view on GitHub
view source