public final class SemanticOps
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static QDataSet |
bounds(QDataSet ds)
return the bounds DS[ JOIN_0=x,y; BINS_1=min,maxInclusive ] of the datasets
independent parameters.
|
static QDataSet |
cadenceCheck(QDataSet tds,
QDataSet ds)
return a dataset with 1's where the cadence preceeding this measurement is acceptable, and 0's where
there should be a break in the data.
|
static boolean |
checkPropertyType(java.lang.String prop,
java.lang.Object value,
boolean throwException)
verify property types.
|
static java.lang.Double |
doubleValue(java.lang.Number value)
returns the Double value of the number, preserving null and NaN.
|
static java.lang.String[] |
getComponentLabels(QDataSet ds)
return the labels for a dataset using BUNDLE_1 and DEPEND_1.
|
static java.lang.String[] |
getComponentNames(QDataSet ds)
return the labels for a bundle dataset.
|
static Datum |
getDatum(QDataSet ds,
double d)
returns the value as a datum.
|
static QDataSet |
getDependentDataSet(QDataSet ds)
return the dataset that is dependent on others.
|
static UnitsConverter |
getLooseUnitsConverter(QDataSet src,
QDataSet dst)
returns the UnitsConverter, or IDENTITY if the converter cannot be found
and one of the two units is dimensionless.
|
static QDataSet |
getPlanarView(QDataSet ds,
java.lang.String name)
returns the plane requested by name, or null if it does not exist.
|
static java.lang.String |
getPropertyType(java.lang.String prop)
return the property type expected for the property.
|
static QDataSet |
getSimpleTableContaining(QDataSet tds,
Datum x,
Datum y)
return the first table of the bundle containing x and y
|
static Units |
getUnits(QDataSet ds)
returns the units found in the UNITS property of the dataset,
or Units.dimensionless if it is not found.
|
static UnitsConverter |
getUnitsConverter(QDataSet src,
QDataSet dst)
return the UnitsConverter that will convert data from src to the units of dst.
|
static Datum |
guessXTagWidth(QDataSet ds,
QDataSet yds)
return a reasonable tag width to use, or null if one cannot be
guessed.
|
static boolean |
isBins(QDataSet ds)
Test for bins scheme, where BINS_1 (or BINS_0) is set.
|
static boolean |
isBundle(QDataSet ds)
Test for bundle scheme.
|
static boolean |
isJoin(QDataSet ds)
returns true if the dataset is rank 2 or greater with the first dimension a join dimension.
|
static boolean |
isLegacyBundle(QDataSet zds)
See Ops.isLegacyBundle
|
static boolean |
isMonotonic(QDataSet ds)
returns true if the dataset indicates that it is monotonically
increasing.
|
static boolean |
isRank1Bundle(QDataSet ds)
returns true if the rank 1 dataset is a bundle of rank 0 datasets, or
where DEPEND_0 is a labels dataset.
|
static boolean |
isRank2Waveform(QDataSet fillDs)
Test for rank 2 waveform dataset, where DEPEND_1 is offset from DEPEND_0,
and the data is the waveform.
|
static boolean |
isRank3JoinOfRank2Waveform(QDataSet ds)
Test for rank 3 dataset that is a join of rank 2 waveform datasets.
|
static boolean |
isSimpleBundleDataSet(QDataSet ds)
returns true if the dataset is a bundle of rank 1 datasets.
|
static boolean |
isSimpleTableDataSet(QDataSet ds)
returns true if the dataset is the scheme of a legacy TableDataSet
with only one table.
|
static boolean |
isTableDataSet(QDataSet ds)
returns true if the dataset is the scheme of a legacy TableDataSet
|
static boolean |
isTimeSeries(QDataSet ds)
returns true if the dataset is a time series.
|
static boolean |
isYXT(QDataSet ds)
YXT is a dataset where T → X → Y.
|
static Units |
lookupTimeLengthUnit(java.lang.String s)
Deprecated.
use Units.lookupTimeLengthUnit
|
static Units |
lookupTimeUnits(Datum base,
Units offsetUnits)
Deprecated.
use Units.lookupTimeUnits
|
static Units |
lookupTimeUnits(java.lang.String units)
Deprecated.
use Units.lookupTimeUnits
|
static Units |
lookupUnits(java.lang.String sunits)
Deprecated.
use Units.lookupUnits
|
static QDataSet |
trim(QDataSet ds,
DatumRange xrange,
DatumRange yrange)
return the parts of the dataset within the bounds.
|
static QDataSet |
weightsDataSet(QDataSet ds)
return the weights dataset, possibly creating one based on VALID_MIN
VALID_MAX and FILL_VALUE properties.
|
static QDataSet |
xtagsDataSet(QDataSet ds)
return the dataset containing the x tags for the dataset.
|
static QDataSet |
ytagsDataSet(QDataSet ds)
return the ytags for the simple table that is ds.
rank 2 spectrogram: Z[X,Y] → Y
bundle_1: ds[ :, [x,y,z] ] → y
[x,y,z] → y
TODO: consider that these break duck typing goal, and really need a scheme
to tell it how to get the dataset.
|
static QDataSet |
yxt()
YXT is a dataset where T → X → Y.
|
public static Units getUnits(QDataSet ds)
ds
- public static UnitsConverter getUnitsConverter(QDataSet src, QDataSet dst)
src
- the dataset from which we get the original units.dst
- the dataset from which we get the destination units.java.lang.IllegalArgumentException
public static UnitsConverter getLooseUnitsConverter(QDataSet src, QDataSet dst)
src
- the dataset from which we get the original units.dst
- the dataset from which we get the destination units.InconvertibleUnitsException
- when it just can't be done (EnumerationUnits and Ratiometric)public static java.lang.String[] getComponentNames(QDataSet ds)
ds
- rank 1 or rank 2 bundle.public static java.lang.String[] getComponentLabels(QDataSet ds)
ds
- the dataset, with a BUNDLE_1 or DEPEND_1 dimension which could be used.public static Units lookupUnits(java.lang.String sunits)
sunits
- string identifier.public static Units lookupTimeLengthUnit(java.lang.String s) throws java.text.ParseException
s
- java.text.ParseException
public static Units lookupTimeUnits(java.lang.String units) throws java.text.ParseException
units
- string like "microseconds since 2000-001T00:00"java.text.ParseException
public static Units lookupTimeUnits(Datum base, Units offsetUnits)
base
- the base time, for example 2000-001T00:00.offsetUnits
- the offset units for example microseconds. Positive values of the units will be since the base time.public static boolean isRank1Bundle(QDataSet ds)
ds
- a datasetpublic static boolean isBundle(QDataSet ds)
ds
- public static boolean isRank2Waveform(QDataSet fillDs)
fillDs
- public static boolean isRank3JoinOfRank2Waveform(QDataSet ds)
ds
- public static boolean isLegacyBundle(QDataSet zds)
zds
- public static boolean isBins(QDataSet ds)
ds
- public static boolean isMonotonic(QDataSet ds)
ds
- public static boolean isJoin(QDataSet ds)
ds
- public static QDataSet getPlanarView(QDataSet ds, java.lang.String name)
ds
- name
- public static QDataSet weightsDataSet(QDataSet ds)
ds
- which is equivalent
,
which detects for gaps in cadence.
public static Datum guessXTagWidth(QDataSet ds, QDataSet yds)
ds
- the dataset containing data with a cadence.yds
- null or a dataset that may contain fill.public static QDataSet xtagsDataSet(QDataSet ds)
ds
- public static QDataSet ytagsDataSet(QDataSet ds)
ds
- the datasetpublic static QDataSet getSimpleTableContaining(QDataSet tds, Datum x, Datum y)
tds
- x
- y
- public static QDataSet getDependentDataSet(QDataSet ds)
ds
- public static QDataSet bounds(QDataSet ds)
rank 2 Tables | extent(X),extent(Y) and Z is not represented |
rank 3 array of tables | extent(X),extent(Y) and Z is not represented |
rank 1 Y(X) | extent(X),extent(Y) |
not for rank 2 bundle dataset | |
not for rank 1 bundle dataset |
bounds[0,0]= X min | bounds[0,1] = X max | bounds.slice(0) is the extent of X | |
bounds[1,0]= Y min | bounds[1,1] = Y max | bounds.slice(1) is the extent of Y |
ds
- rank 2 dataset with BINS_1="min,maxInclusive"java.lang.IllegalArgumentException
- when the dataset scheme is not supportedpublic static boolean isTableDataSet(QDataSet ds)
ds
- public static boolean isSimpleTableDataSet(QDataSet ds)
ds
- public static boolean isSimpleBundleDataSet(QDataSet ds)
X,Y --> Y(X) X,Y,Z --> Z(X,Y)
ds
- public static boolean isTimeSeries(QDataSet ds)
ds
- public static java.lang.Double doubleValue(java.lang.Number value)
value
- public static Datum getDatum(QDataSet ds, double d)
ds
- dataset providing the UNITS and VALID_MIN, VALID_MAX and FILL_VALUE.d
- the double.public static QDataSet trim(QDataSet ds, DatumRange xrange, DatumRange yrange)
ds
- the rank 1 or more dataset, including joins.xrange
- the range or null if no trimming should be doneyrange
- the range or null if no trimming should be donepublic static boolean isYXT(QDataSet ds)
ds
- public static QDataSet yxt()
public static QDataSet cadenceCheck(QDataSet tds, QDataSet ds)
Presently this just uses guessXTagWidth to get the cadence, but this may allow a future version to support mode changes. The result is a dataset with the same length, and the zeroth element is always 1.findex= Ops.interpolate( xds, x ) cadenceCheck= cadenceCheck(xds) r= where( cadenceCheck[floor(findex)] eq 0 ) x[r]= fill
tds
- rank 1 dataset of length N.ds
- dataset dependent on tds and used to detect valid measurements, or null.which checks for fill and valid_min, valid_max.
public static boolean checkPropertyType(java.lang.String prop, java.lang.Object value, boolean throwException)
prop
- the property name, e.g. QDataSet.CADENCEvalue
- the candidate value for the property.throwException
- if true, throw descriptive exception instead of returning false.public static java.lang.String getPropertyType(java.lang.String prop)
prop
-