public interface QDataSet
QDataSets are the data model used within Das2 and Autoplot. It was preceded by a more specific data model, used to developed to deliver spectrogram time series data sets where the dataset structure would change over time, and the interface is highly optimized for that environment. It was difficult to express many datasets in these terms, so the simpler "quick" QDataSet was introduced.
The QDataSet can be thought of as a fast Java array that has name-value metadata attached to it. These arrays of data can have an arbitrary number of indexes, or rank, although currently the interface limits rank to 0, 1, 2, 3, and 4. Each index's length can vary, like Java arrays, and datasets where the dimensions do not vary in length are colloquially called "Qubes."
QDataSets have standard metadata like NAME and UNITS, identifying the data and the units used to interpret the numbers.
QDataSets can have other QDataSets as property values. For example, the property QDataSet.DEPEND_0 indicates that the values are dependent parameters of the independent "tags" QDataSet found there. QDataSet.BUNDLE_1 means the index is used to access datasets bundled together sharing the same time tags.
This is inspired by the CDF data model and PaPCo's dataset model, and has evolved to support data in many forms.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AVERAGE_TYPE
String, Indicates how numbers should be combined in this space.
|
static java.lang.String |
BIN_MAX
QDataSet of rank 1 identifies boundary in the same units as the dataset.
|
static java.lang.String |
BIN_MAX_NAME
name of the dataset in a bundle to be connected to BIN_MAX.
|
static java.lang.String |
BIN_MIN
QDataSet of rank 1 identifies boundary in the same units as the dataset.
|
static java.lang.String |
BIN_MIN_NAME
name of the dataset in a bundle to be connected to BIN_MIN.
|
static java.lang.String |
BIN_MINUS
QDataSet of rank 0 or correlated QDataSet identifies boundary.
|
static java.lang.String |
BIN_MINUS_NAME
name of the dataset in a bundle to be connected to BIN_MINUS.
|
static java.lang.String |
BIN_PLUS
QDataSet of rank 0 or correlated QDataSet identifies boundary.
|
static java.lang.String |
BIN_PLUS_NAME
name of the dataset in a bundle to be connected to BIN_PLUS.
|
static java.lang.String |
BINS_0
type String which is a comma-delimited list of keywords that describe the boundary
type for each column.
|
static java.lang.String |
BINS_1
type String which is a comma-delimited list of keywords that describe the boundary
type for each column.
|
static java.lang.String |
BUNDLE_0
type QDataSet describing each position of the rank 1 dataset (Bundle Descriptor).
|
static java.lang.String |
BUNDLE_1
type QDataSet describing each of the bundled datasets (Bundle Descriptor).
|
static java.lang.String |
BUNDLE_2
type QDataSet Bundle Descriptor.
|
static java.lang.String |
BUNDLE_3
type QDataSet Bundle Descriptor.
|
static java.lang.String |
CACHE_TAG
CacheTag, indicating the coverage and resolution of a dimension.
|
static java.lang.String |
CADENCE
QDataSet of rank0, which is the expected distance between successive
measurements where it is valid to make inferences about the data.
|
static java.lang.String |
CONTEXT_0
type QDataSet, that stores the position of a slice or range in
a collapsed dimension.
|
static java.lang.String |
CONTEXT_1
type QDataSet, that stores the position of a slice or range in
a collapsed dimension.
|
static java.lang.String |
COORDINATE_FRAME
String, representing the coordinate frame of the vector index.
|
static double |
DEFAULT_FILL_VALUE
the fill value often used in codes.
|
static java.lang.String |
DELTA_MINUS
QDataSet of rank 0, or correlated QDataSet that limits accuracy.
|
static java.lang.String |
DELTA_MINUS_NAME
name of the dataset in a bundle to be connected to DELTA_MINUS.
|
static java.lang.String |
DELTA_PLUS
QDataSet of rank 0, or correlated QDataSet that limits accuracy.
|
static java.lang.String |
DELTA_PLUS_NAME
name of the dataset in a bundle to be connected to DELTA_PLUS.
|
static java.lang.String |
DEPEND_0
type QDataSet, this dataset is a dependent parameter of the independent parameter represented in this DataSet.
|
static java.lang.String |
DEPEND_1
type QDataSet, this dataset is a dependent parameter of the independent parameter represented in this DataSet.
|
static java.lang.String |
DEPEND_2
type QDataSet, this dataset is a dependent parameter of the independent parameter represented in this DataSet.
|
static java.lang.String |
DEPEND_3
type QDataSet, this dataset is a dependent parameter of the independent parameter represented in this DataSet.
|
static java.lang.String |
DEPENDNAME_0
String, the name of another dataset in the bundle descriptor.
|
static java.lang.String |
DEPENDNAME_1
String, the name of another dataset in the bundle descriptor.
|
static java.lang.String |
DESCRIPTION
String, Human-consumable string suitable for describing the data more fully.
|
static java.lang.String |
ELEMENT_DIMENSIONS
int array, the dimensions of the element.
|
static java.lang.String |
ELEMENT_LABEL
String, the label of the rank 2 or more dataset in a bundle descriptor.
|
static java.lang.String |
ELEMENT_NAME
String, the name of the rank 2 or more dataset in a bundle descriptor.
|
static java.lang.String |
FILL_VALUE
type Number, value to be considered fill (invalid) data.
|
static java.lang.String |
FORMAT
type String, Java/C format string for formatting the values.
|
static java.lang.String |
JOIN_0
type String, non-null string identifies that elements in this dimension are
instances of data with the same dimensions.
|
static java.lang.String |
LABEL
String, Concise Human-consumable label suitable for a plot label (~10 chars).
|
static long |
LIMIT_HUGE_DATASET
reference value for the size of a dataset where we would expect to start seeing
performance degradation.
|
static int |
MAX_HIGH_RANK
the highest rank supported by the library, without direct access
to datums.
|
static int |
MAX_PLANE_COUNT
the maximum number of allowed planes.
|
static int |
MAX_RANK
the highest rank supported by the library.
|
static int |
MAX_UNIT_BUNDLE_COUNT
maximum number of same-unit bundled dimensions (e.g.
|
static java.lang.String |
METADATA
Map<String,Object> representing additional properties used by client codes.
|
static java.lang.String |
METADATA_MODEL
String, a scheme for the metadata tree, such as ISTP or SPASE.
|
static int |
MIN_WAVEFORM_LENGTH
the minimum length of each of the waveform packets in a rank 2 waveform dataset.
|
static java.lang.String |
MONOTONIC
Boolean, Boolean.TRUE if dataset is monotonically increasing, and the data is rank 1.
|
static java.lang.String |
NAME
String, a java identifier that should can be used when an identifier is needed.
|
static java.lang.String |
NOTES
QDataSet of events scheme, containing a list of messages encountered during processing that annotate the data.
|
static java.lang.String |
PLANE_0
type QDataSet, a correlated plane of data.
|
static java.lang.String |
QUBE
Boolean.TRUE indicates that the dataset is a "qube," meaning
that all dimensions have fixed length and certain optimizations and
operators are allowed.
|
static java.lang.String |
RENDER_TYPE
String, hint as to preferred rendering method.
|
static java.lang.String |
SCALE_TYPE
String, "linear" or "log", hinting at the preference for linear or a log
axis.
|
static java.lang.String |
SOURCE
String, Human-consumable string identifying the source of a dataset, such as the file or URI from
which it was read.
|
static java.lang.String |
START_INDEX
type Integer, only found in a bundle descriptor (BUNDLE_0 or BUNDLE_1), this returns the integer
index of the start of the current dataset.
|
static java.lang.String |
TITLE
String, Human-consumable string suitable for a plot title (~100 chars).
|
static java.lang.String |
TYPICAL_MAX
type Number that is the max used to discover datasets.
|
static java.lang.String |
TYPICAL_MIN
type Number that is min used to discover datasets.
|
static java.lang.String |
UNITS
type Units indicating the units of the dataset in the enumeration of
org.das2.datum.Units, as in org.das2.datum.Units.km.
|
static java.lang.String |
USER_PROPERTIES
Map<String,Object> representing additional properties used by client codes.
|
static java.lang.String |
VALID_MAX
type Number, maximum bounding measurements to be considered valid.
|
static java.lang.String |
VALID_MIN
type Number, minimum bounding measurements to be considered valid.
|
static java.lang.String |
VALUE_AVERAGE_TYPE_GEOMETRIC
geometric mean where result is exp(sum(log(ds))/len(ds))
|
static java.lang.String |
VALUE_AVERAGE_TYPE_LINEAR
typical averages sum(ds)/len(ds)
|
static java.lang.String |
VALUE_AVERAGE_TYPE_MOD24
mod24 mean where avg([23,1]) is 0.
|
static java.lang.String |
VALUE_AVERAGE_TYPE_MOD360
mod360 mean where avg([359,1]) is 0.
|
static java.lang.String |
VALUE_AVERAGE_TYPE_MODPI
modpi mean where avg( [5*PI/6,7*PI/6] ) is 0.
|
static java.lang.String |
VALUE_AVERAGE_TYPE_MODTAU
modtau mean where avg( [5*TAU/6,7*TAU/6] ) is 0.
|
static java.lang.String |
VALUE_AVERAGE_TYPE_NONE
combining numbers is not allowed, and often nearest neighbor is a suitable result.
|
static java.lang.String |
VALUE_BINS_MIN_MAX
typical bin is min,max with min inclusive and max exclusive.
|
static java.lang.String |
VALUE_BINS_MIN_MAX_INCLUSIVE
typical bin is min,max with min inclusive and max exclusive.
|
static java.lang.String |
VALUE_COORDINATE_FRAME_COMPLEX_NUMBER
the value is a complex number, having two elements, the first is real second is imaginary.
|
static java.lang.String |
VALUE_METADATA_MODEL_ISTP
the metadata is ISTP-CDF metadata
|
static java.lang.String |
VALUE_METADATA_MODEL_SPASE
the metadata is SPASE (Space Physics Archive Search Extract)
|
static java.lang.String |
VALUE_RENDER_TYPE_COMPOSITE_IMAGE
values are an RGB image, a rank 3 dataset [w,h,3] or [w,h,4].
|
static java.lang.String |
VALUE_RENDER_TYPE_DIGITAL
values are drawn.
|
static java.lang.String |
VALUE_RENDER_TYPE_EVENTS_BAR
draw events bars
|
static java.lang.String |
VALUE_RENDER_TYPE_NNSPECTROGRAM
use blocks to draw each point, so data extents can be seen.
|
static java.lang.String |
VALUE_RENDER_TYPE_SERIES
full-fidelity rendering of buckshot and connect-a-dot plots
|
static java.lang.String |
VALUE_RENDER_TYPE_TRIANGLE_MESH
triangle mesh type
|
static java.lang.String |
VALUE_SCALE_TYPE_LINEAR
scale type to suggest linear axes and bins.
|
static java.lang.String |
VALUE_SCALE_TYPE_LOG
scale type to suggest log axes and bins.
|
static java.lang.String |
VERSION
String, human consumable identifying data version.
|
static java.lang.String |
WEIGHTS
QDataSet, dataset of same geometry that indicates the weights for each point.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
capability(java.lang.Class<T> clazz)
return null or an object implementing the capability for the given interface
For example:
|
int |
length()
return the length of the first dimension
|
int |
length(int i)
return the length of the second dimension, for the ith element of the first dimension.
|
int |
length(int i,
int j)
return the length of the third dimension, for the ith element of the first dimension and jth element of the second dimension.
|
int |
length(int i,
int j,
int k)
return the length of the fourth dimension for the ith, jth and kth elements of the first three dimensions.
|
java.lang.Object |
property(java.lang.String name)
accessor for properties attached to the dataset.
|
java.lang.Object |
property(java.lang.String name,
int i)
accessor for properties attached to the dataset's first index.
|
int |
rank()
returns the rank of the dataset, which is the number of indeces used to access data.
|
QDataSet |
slice(int i)
return a dataset that is a slice of this dataset, slicing on the zeroth
dimension.
|
java.lang.String |
svalue()
rank 0 accessor which provides the string value
|
QDataSet |
trim(int start,
int end)
return a dataset that is a subset of this dataset.
|
double |
value()
rank 0 accessor.
|
double |
value(int i)
rank 1 accessor.
|
double |
value(int i0,
int i1)
rank 2 accessor.
|
double |
value(int i0,
int i1,
int i2)
rank 3 accessor.
|
double |
value(int i0,
int i1,
int i2,
int i3)
rank 4 accessor.
|
static final java.lang.String DEPEND_0
static final java.lang.String DEPEND_1
static final java.lang.String DEPEND_2
static final java.lang.String DEPEND_3
static final java.lang.String BUNDLE_1
static final java.lang.String BUNDLE_0
static final java.lang.String BUNDLE_2
static final java.lang.String BUNDLE_3
static final java.lang.String START_INDEX
static final java.lang.String BINS_1
static final java.lang.String BINS_0
static final java.lang.String JOIN_0
static final java.lang.String PLANE_0
static final java.lang.String CONTEXT_0
static final java.lang.String CONTEXT_1
static final int MAX_PLANE_COUNT
static final int MAX_UNIT_BUNDLE_COUNT
static final int MAX_RANK
static final int MAX_HIGH_RANK
static final long LIMIT_HUGE_DATASET
static final java.lang.String UNITS
from org.das2.datum import Units u= Units.lookupUnits('seconds since 2015-001T00:00') ds= findgen(3600) ds= putProperty( ds, QDataSet.UNITS, u ) plot( ds ) # plots line from 00:00 to 01:00.
Units
,
Constant Field Valuesstatic final java.lang.String FORMAT
static final java.lang.String FILL_VALUE
static final java.lang.String VALID_MIN
static final java.lang.String VALID_MAX
static final java.lang.String TYPICAL_MIN
static final java.lang.String TYPICAL_MAX
static final java.lang.String SCALE_TYPE
static final java.lang.String AVERAGE_TYPE
static final java.lang.String LABEL
static final java.lang.String TITLE
static final java.lang.String DESCRIPTION
static final java.lang.String WEIGHTS
static final java.lang.String MONOTONIC
static final java.lang.String CADENCE
static final java.lang.String DELTA_PLUS
for measurement intervals.
,
Constant Field Valuesstatic final java.lang.String DELTA_MINUS
for measurement intervals.
,
Constant Field Valuesstatic final java.lang.String BIN_PLUS
static final java.lang.String BIN_MINUS
static final java.lang.String BIN_MAX
which is the offset.
,
Constant Field Valuesstatic final java.lang.String BIN_MIN
which is the offset.
,
Constant Field Valuesstatic final java.lang.String BIN_MIN_NAME
static final java.lang.String BIN_MAX_NAME
static final java.lang.String BIN_MINUS_NAME
static final java.lang.String BIN_PLUS_NAME
static final java.lang.String DELTA_PLUS_NAME
static final java.lang.String DELTA_MINUS_NAME
static final java.lang.String CACHE_TAG
static final java.lang.String RENDER_TYPE
static final java.lang.String VALUE_AVERAGE_TYPE_NONE
static final java.lang.String VALUE_AVERAGE_TYPE_LINEAR
static final java.lang.String VALUE_AVERAGE_TYPE_GEOMETRIC
static final java.lang.String VALUE_AVERAGE_TYPE_MOD24
static final java.lang.String VALUE_AVERAGE_TYPE_MOD360
static final java.lang.String VALUE_AVERAGE_TYPE_MODPI
static final java.lang.String VALUE_AVERAGE_TYPE_MODTAU
static final java.lang.String VALUE_RENDER_TYPE_SERIES
static final java.lang.String VALUE_RENDER_TYPE_NNSPECTROGRAM
static final java.lang.String VALUE_RENDER_TYPE_EVENTS_BAR
static final java.lang.String VALUE_RENDER_TYPE_DIGITAL
static final java.lang.String VALUE_RENDER_TYPE_COMPOSITE_IMAGE
static final java.lang.String VALUE_RENDER_TYPE_TRIANGLE_MESH
static final java.lang.String NAME
static final java.lang.String QUBE
static final java.lang.String COORDINATE_FRAME
static final java.lang.String METADATA
static final java.lang.String METADATA_MODEL
static final java.lang.String VALUE_METADATA_MODEL_ISTP
static final java.lang.String VALUE_METADATA_MODEL_SPASE
static final java.lang.String VALUE_COORDINATE_FRAME_COMPLEX_NUMBER
static final java.lang.String VERSION
static final java.lang.String SOURCE
static final java.lang.String NOTES
static final java.lang.String DEPENDNAME_0
static final java.lang.String DEPENDNAME_1
static final java.lang.String ELEMENT_NAME
static final java.lang.String ELEMENT_LABEL
static final java.lang.String ELEMENT_DIMENSIONS
static final java.lang.String USER_PROPERTIES
static final java.lang.String VALUE_BINS_MIN_MAX
static final java.lang.String VALUE_BINS_MIN_MAX_INCLUSIVE
static final java.lang.String VALUE_SCALE_TYPE_LOG
static final java.lang.String VALUE_SCALE_TYPE_LINEAR
static final int MIN_WAVEFORM_LENGTH
static final double DEFAULT_FILL_VALUE
int rank()
double value()
java.lang.IllegalArgumentException
- if the dataset is not rank 0.java.lang.String svalue()
java.lang.IllegalArgumentException
- if the dataset is not rank 0.double value(int i)
i
- the indexjava.lang.IllegalArgumentException
- if the dataset is not rank 1.double value(int i0, int i1)
i0
- the indexi1
- the indexjava.lang.IllegalArgumentException
- if the dataset is not rank 2.double value(int i0, int i1, int i2)
i0
- the indexi1
- the indexi2
- the indexjava.lang.IllegalArgumentException
- if the dataset is not rank 3.double value(int i0, int i1, int i2, int i3)
i0
- the indexi1
- the indexi2
- the indexi3
- the indexjava.lang.IllegalArgumentException
- if the dataset is not rank 4.java.lang.Object property(java.lang.String name)
java.lang.Object property(java.lang.String name, int i)
int length()
int length(int i)
i
- the indexint length(int i, int j)
i
- the indexj
- the indexint length(int i, int j, int k)
i
- the indexj
- the indexk
- the indexQDataSet slice(int i)
i
- the index to slice atjava.lang.IllegalArgumentException
- when dataset rank is zero.QDataSet trim(int start, int end)
ds= DDataSet.createRank1(100);
QDataSet trim= ds.trim(50,60);
assert( trim.length()==10 );
Note start and end must be positive. Negative indices,
referenced from the end of the dataset, are not supported here.start
- the first index to be included in the new dataset.end
- the exclusive index indicating the last index.<T> T capability(java.lang.Class<T> clazz)
This allows operations to be performed efficiently. Note there is no WriteCapability class, this is just an example.ds= DDataSet.createRank1(100); WriteCapability write= ds.capability( WriteCapability.class ); write.putValue( 99, -1e31 );
T
- a capabilityclazz
- the class, such as WriteCapability.classLongWriteAccess
,
LongReadAccess
,
FloatReadAccess