public abstract class Set extends DataImpl implements SetIface
Set is the abstract superclass of the VisAD hierarchy of sets.
Set-s are subsets of R^n for n>0. For the most part, Set objects are
immutable (but see SampledSet.getSamples(boolean)
).
DataImpl.Syncher
ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE
Constructor and Description |
---|
Set(MathType type)
construct a Set object
|
Set(MathType type,
CoordinateSystem coord_sys)
Constructs a Set object with a non-default CoordinateSystem.
|
Set(MathType type,
CoordinateSystem coord_sys,
Unit[] units,
ErrorEstimate[] errors)
Constructs a Set object with a non-default CoordinateSystem, non-default
Unit-s, and non-default errors.
|
Modifier and Type | Method and Description |
---|---|
Data |
__getitem__(int index)
for JPython
|
int |
__len__()
A wrapper around
getLength for JPython. |
void |
addEqualsCache(Set set)
add set to a cache of Set-s equal to this
|
void |
addNotEqualsCache(Set set)
add set to a cache of Set-s not equal to this
|
Object |
clone()
Clones this instance.
|
abstract Object |
cloneButType(MathType type)
copy this Set, but give it a new MathType;
this is safe, since constructor checks consistency of
DomainCoordinateSystem and SetUnits with Type
|
DataShadow |
computeRanges(ShadowType type,
DataShadow shadow)
Recursive version of computeRanges(), called down through
Data object tree.
|
DataShadow |
computeRanges(ShadowType type,
DataShadow shadow,
double[][] ranges,
boolean domain)
this default does not set ranges - it is used by FloatSet and
DoubleSet
|
static double[][] |
copyDoubles(double[][] samples) |
static float[][] |
copyFloats(float[][] samples) |
void |
cram_missing(boolean[] range_select) |
static float[][] |
doubleToFloat(double[][] value) |
int[] |
doubleToIndex(double[][] value) |
abstract boolean |
equals(Object set)
test for equality
|
boolean |
equalUnitAndCS(Set set)
test equality of SetUnits and DomainCoordinateSystem
between this and set
|
static double[][] |
floatToDouble(float[][] value) |
CoordinateSystem |
getCoordinateSystem()
Gets the coordinate system of this domain set (DomainCoordinateSystem).
|
int |
getDimension()
get DomainDimension (i.e., this is a subset of R^DomainDimension)
|
double[][] |
getDoubles()
Returns an enumeration of the samples of the set in index order.
|
double[][] |
getDoubles(boolean copy)
Returns an enumeration of the samples of the set in index order.
|
int |
getLength()
get the number of samples
|
int |
getManifoldDimension()
for non-SimpleSet, ManifoldDimension = DomainDimension
|
int[][] |
getNeighbors(int dimension)
Returns the indexes of the neighboring points along a manifold
dimesion for every point in the set.
|
void |
getNeighbors(int[][] neighbors)
Returns the indexes of the neighboring points for every point
in the set.
|
void |
getNeighbors(int[][] neighbors,
float[][] weights) |
float[][] |
getSamples()
return an enumeration of sample values in index order
(i.e., not in getWedge order); the return array is
organized as float[domain_dimension][number_of_samples]
|
float[][] |
getSamples(boolean copy)
Returns an enumeration of the samples of the set in index order.
|
ErrorEstimate[] |
getSetErrors()
Returns the error estimates of the values in the set.
|
Unit[] |
getSetUnits()
Returns the units of the values in the set.
|
int[] |
getWedge()
return an enumeration of sample indices in a spatially
coherent order; this is useful for efficiency
|
double[][] |
indexToDouble(int[] index)
Returns an array of sample-point values corresponding to an array of
sample-point indicies.
|
abstract float[][] |
indexToValue(int[] index)
return Set values corresponding to Set indices
|
String |
longString() |
String |
longString(String pre) |
static void |
main(String[] args) |
VisADGeometryArray |
make1DGeometry(byte[][] color_values) |
VisADGeometryArray |
make2DGeometry(byte[][] color_values,
boolean indexed) |
VisADGeometryArray[] |
make3DGeometry(byte[][] color_values) |
VisADGeometryArray[][] |
makeIsoLines(float[] intervals,
float lowlimit,
float highlimit,
float base,
float[] fieldValues,
byte[][] color_values,
boolean[] swap,
boolean dash,
boolean fill,
ScalarMap[] smap,
double[] scale,
double label_size,
boolean sphericalDisplayCS)
return basic lines in array[0], fill-ins in array[1]
and labels in array[2]
|
VisADGeometryArray |
makeIsoSurface(float isolevel,
float[] fieldValues,
byte[][] color_values,
boolean indexed) |
VisADGeometryArray |
makePointGeometry(byte[][] color_values) |
Set |
makeSpatial(SetType type,
float[][] samples) |
Set |
merge1DSets(Set set)
merge 1D sets; used for default animation set
|
boolean |
testEqualsCache(Set set)
test set against a cache of Set-s equal to this
|
boolean |
testNotEqualsCache(Set set)
test set against a cache of Set-s not equal to this
|
Data |
unary(int op,
MathType new_type,
int sampling_mode,
int error_mode)
Pointwise unary operation applied to this.
|
int |
unitAndCSHashCode()
Returns the hash code of the units and coordinate-system.
|
abstract int[] |
valueToIndex(float[][] value)
return Set indices of Set values closest to value elements
(return -1 for any value outside Set range)
|
__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, adjustSamplingError, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, toString, unary
addReference, removeReference
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, adjustSamplingError, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, isMissing, local, log, log, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary
addReference, removeReference
public Set(MathType type) throws VisADException
VisADException
public Set(MathType type, CoordinateSystem coord_sys) throws VisADException
type
- The type of the Set.coord_sys
- The CoordinateSystem associated with this
Set.VisADException
public Set(MathType type, CoordinateSystem coord_sys, Unit[] units, ErrorEstimate[] errors) throws VisADException
type
- The MathType of the set. May be a RealType,
a RealTupleType, or a SetType.coord_sys
- Optional coordinate system for the domain of the
set. May be null
, in which case
the default coordinate system of the domain is
used.units
- Optional units for the values. May
be null
, in which case
the default units of the domain are
used. If the i
th element is
non-null
and the RealType of the
corresponding domain component is an interval,
then the unit that is actually used is
units[i].getAbsoluteUnit()
.errors
- Error estimates. May be null
.
errors[i]
is the error estimate
for the i
-th component and may be
null
.VisADException
public Unit[] getSetUnits()
getSetUnits
in interface SetIface
null
. RETURN_VALUE[i]
is the unit of the i
-th component
and may be null
.public ErrorEstimate[] getSetErrors()
getSetErrors
in interface SetIface
null
. RETURN_VALUE[i]
is the error estimate for the i
-th
component and may be null
.public CoordinateSystem getCoordinateSystem()
getCoordinateSystem
in interface SetIface
null
; otherwise, the
(default) coordinate system of the
underlying RealTupleType (which may be
null
).public int getDimension()
getDimension
in interface SetIface
public int getManifoldDimension()
getManifoldDimension
in interface SetIface
public int getLength() throws VisADException
getLength
in interface SetIface
VisADException
public int __len__() throws VisADException
getLength
for JPython.VisADException
public int[] getWedge()
public float[][] getSamples() throws VisADException
getSamples
in interface SetIface
VisADException
- VisAD failure.SetIface.getSamples(boolean copy)
public float[][] getSamples(boolean copy) throws VisADException
SetIface
getSamples
in interface SetIface
copy
- Whether or not to make a copy of the samples
of the set.VisADException
- VisAD failure.public double[][] getDoubles() throws VisADException
SetIface
getDoubles(true)
.getDoubles
in interface SetIface
VisADException
- VisAD failure.SetIface.getDoubles(boolean copy)
public double[][] getDoubles(boolean copy) throws VisADException
SetIface
getDoubles
in interface SetIface
copy
- Whether or not to make a copy of the samples
of the set.VisADException
- VisAD failure.public void cram_missing(boolean[] range_select)
cram_missing
in interface SetIface
public abstract float[][] indexToValue(int[] index) throws VisADException
indexToValue
in interface SetIface
index
- array of integer indicesVisADException
- a VisAD error occurredpublic abstract int[] valueToIndex(float[][] value) throws VisADException
valueToIndex
in interface SetIface
value
- float[domain_dimension][number_of_values] array of
Set valuesVisADException
- a VisAD error occurredpublic DataShadow computeRanges(ShadowType type, DataShadow shadow) throws VisADException
Data
computeRanges
in interface Data
type
- ShadowType generated for MathType of thisshadow
- DataShadow instance whose contained double[][]
array and animation sampling Set are modified
according to RealType values in this, and used
as return valueVisADException
- a VisAD error occurredpublic DataShadow computeRanges(ShadowType type, DataShadow shadow, double[][] ranges, boolean domain) throws VisADException
VisADException
public Set merge1DSets(Set set) throws VisADException
merge1DSets
in interface SetIface
VisADException
public Set makeSpatial(SetType type, float[][] samples) throws VisADException
makeSpatial
in interface SetIface
VisADException
public VisADGeometryArray make1DGeometry(byte[][] color_values) throws VisADException
make1DGeometry
in interface SetIface
VisADException
public VisADGeometryArray make2DGeometry(byte[][] color_values, boolean indexed) throws VisADException
make2DGeometry
in interface SetIface
VisADException
public VisADGeometryArray[] make3DGeometry(byte[][] color_values) throws VisADException
make3DGeometry
in interface SetIface
VisADException
public VisADGeometryArray makePointGeometry(byte[][] color_values) throws VisADException
makePointGeometry
in interface SetIface
VisADException
public VisADGeometryArray[][] makeIsoLines(float[] intervals, float lowlimit, float highlimit, float base, float[] fieldValues, byte[][] color_values, boolean[] swap, boolean dash, boolean fill, ScalarMap[] smap, double[] scale, double label_size, boolean sphericalDisplayCS) throws VisADException
makeIsoLines
in interface SetIface
VisADException
public VisADGeometryArray makeIsoSurface(float isolevel, float[] fieldValues, byte[][] color_values, boolean indexed) throws VisADException
makeIsoSurface
in interface SetIface
VisADException
public double[][] indexToDouble(int[] index) throws VisADException
indexToDouble
in interface SetIface
index
- The indicies of the sample points.[i][j]
is the
j
th component of sample-point
i
.VisADException
- if a VisAD failure occurs.public int[] doubleToIndex(double[][] value) throws VisADException
doubleToIndex
in interface SetIface
VisADException
public static double[][] floatToDouble(float[][] value)
public static float[][] doubleToFloat(double[][] value)
public static float[][] copyFloats(float[][] samples)
public static double[][] copyDoubles(double[][] samples)
public void getNeighbors(int[][] neighbors) throws VisADException
Returns the indexes of the neighboring points for every point
in the set. neighbors.length
should be at least
getLength()
. On return, neighbors[i][j]
will be the index of the j
-th neighboring point of
point i
. This method will allocate and set the array
neighbors[i]
for all i
.
This implementation always throws an UnimplementedException
.
getNeighbors
in interface SetIface
neighbors
- The array to contain the indexes of the
neighboring points.NullPointerException
- if the array is null
.ArrayIndexOutOfBoundsException
- if neighbors.length < getLength()
.VisADException
- if a VisAD failure occurs.public void getNeighbors(int[][] neighbors, float[][] weights) throws VisADException
getNeighbors
in interface SetIface
VisADException
public int[][] getNeighbors(int dimension) throws VisADException
Returns the indexes of the neighboring points along a manifold
dimesion for every point in the set. Elements [i][0]
and [i][1]
of the returned array are the indexes of the
neighboring sample points in the direction of decreasing and increasing
manifold index, respectively, for sample point i
. If a sample
point doesn't have a neighboring point (because it is an exterior point,
for example) then the value of the corresponding index will be -1.
This implementation always throws an UnimplementedException
.
getNeighbors
in interface SetIface
dimension
- The index of the manifold dimension along
which to return the neighboring points.ArrayIndexOutOfBoundsException
- if manifoldIndex < 0 ||
manifoldIndex >= getManifoldDimension()
.VisADException
- if a VisAD failure occurs.getManifoldDimension()
public boolean testNotEqualsCache(Set set)
public void addNotEqualsCache(Set set)
public boolean testEqualsCache(Set set)
public void addEqualsCache(Set set)
public boolean equalUnitAndCS(Set set)
equalUnitAndCS
in interface SetIface
public int unitAndCSHashCode()
equalUnitAndCS(Set)
.public Data __getitem__(int index) throws VisADException, RemoteException
VisADException
RemoteException
public abstract boolean equals(Object set)
public Object clone()
public Data unary(int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException, RemoteException
DataImpl
unary
in interface Data
unary
in class DataImpl
op
- may be Data.ABS, Data.ACOS, etc; these include all
unary operations defined for Java primitive data typesnew_type
- MathType of the resultsampling_mode
- may be Data.NEAREST_NEIGHBOR or
Data.WEIGHTED_AVERAGEerror_mode
- may be Data.INDEPENDENT, Data.DEPENDENT or
Data.NO_ERRORS;VisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract Object cloneButType(MathType type) throws VisADException
cloneButType
in interface SetIface
type
- The MathType for the clone.VisADException
- VisAD failure.public String longString() throws VisADException
longString
in interface Data
longString
in class DataImpl
VisADException
public String longString(String pre) throws VisADException
longString
in interface Data
longString
in class DataImpl
pre
- String added to start of each lineVisADException
public static void main(String[] args) throws VisADException
VisADException
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.