|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.ThingImpl visad.DataImpl visad.FunctionImpl visad.FieldImpl visad.FlatField
public class FlatField
FlatField is the VisAD class for finite samplings of functions whose range type and range coordinate systems are simple enough to allow efficient representation. The DomainSet, DomainCoordinateSystem, RangeSet, RangeCoordinateSystem and RangeCoordinateSystems variables of FlatField are immutable.
A FlatField range type may be either a RealType (for a function with range = R), a RealTupleType (for a function with range = R^n for n > 0), or a TupleType of RealType-s and RealTupleType-s..
VisAD avoids invoking methods once per datum through the use of FlatField's. These are logically Field's of Tuple's of RealType's and RealTupleType's. Internally FlatField's are stored as arrays of numerical values, rather than the arrays of data objects stored in Field's. Many of the methods in the FlatField class and in other classes (e.g., CoordinateTransform, Set, Unit) process data in the form double[Dimension][Length] where Length is the number of samples in a Field and Dimension is the number of Tuple elements in the Field range values. Note that the order of the Length and Dimension indices are reversed as array indices. This allows efficient processing of long columns of Field value components. For example, if Latitude is one component of Field values, then any computation involving Latitude can be applied in a tight loop to all Latitude's in the Field.
FlatField's support range types more general than RealTuple's. To understand the motive, consider a set of observations that include Latitude, Longitude, Altitude, Pressure, Temperature, etc. We can organize these as a Field whose range values have the Tuple type:
(Latitude, Longitude, Altitude, Pressure, Temperature, ...)However, in order to declare that (Latitude, Longitude, Altitude) is a coordinate system with coordinate transform functions to other spatial coordinate systems, we need to organize:
(Latitude, Longitude, Altitude)as a RealTupleType. Hence the range type of the Field of observations must be:
((Latitude, Longitude, Altitude), Pressure, Temperature, ...)which is not a RealTupleType (since one of its components is a RealTupleType). In order to process such data efficiently, FlatField's must support range types that are Tuple's of RealType's and RealTupleType's.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class visad.DataImpl |
---|
DataImpl.Syncher |
Field Summary | |
---|---|
protected CoordinateSystem |
RangeCoordinateSystem
|
protected CoordinateSystem[] |
RangeCoordinateSystems
|
protected Unit[] |
RangeUnits
|
protected int |
TupleDimension
|
Fields inherited from interface visad.Data |
---|
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 Summary | |
---|---|
FlatField(FunctionType type)
Constructs a FlatField from a function type. |
|
FlatField(FunctionType type,
Set domain_set)
Constructs a FlatField from a function type and a (non-default) domain Set. |
|
FlatField(FunctionType type,
Set domain_set,
CoordinateSystem[] range_coord_syses,
Set[] range_sets,
Unit[] units)
Constructs a FlatField from a function type, a sampling set of the domain, coordinate systems for the range components, sampling sets for the range components, and units for the range components. |
|
FlatField(FunctionType type,
Set domain_set,
CoordinateSystem range_coord_sys,
CoordinateSystem[] range_coord_syses,
Set[] range_sets,
Unit[] units)
Constructs a FlatField from a function type, a sampling set of the domain, a coordinate system for the range, coordinate systems for the range components, sampling sets for the range components, and units for the range components. |
|
FlatField(FunctionType type,
Set domain_set,
CoordinateSystem range_coord_sys,
Set[] range_sets,
Unit[] units)
Constructs a FlatField from a function type, a sampling set of the domain, a coordinate system for the range, sampling sets for the range components, and units for the range components. |
Method Summary | |
---|---|
Data |
adjustSamplingError(Data error,
int error_mode)
return a FlatField that clones this, except its ErrorEstimate-s are adjusted for sampling errors in error |
Data |
binary(Data data,
int op,
MathType new_type,
int sampling_mode,
int error_mode)
Return new Field with value 'this op data'. |
void |
clearMissing()
Mark this FlatField as non-missing |
Object |
clone()
Clones this instance. |
protected FlatField |
cloneDouble(MathType f_type,
Unit[] units,
ErrorEstimate[] errors)
|
protected FlatField |
cloneDouble(MathType f_type,
Unit[] units,
ErrorEstimate[] errors,
double[][] newValues)
|
protected FlatField |
cloneFloat(MathType f_type,
Unit[] units,
ErrorEstimate[] errors)
|
protected FlatField |
cloneFloat(MathType f_type,
Unit[] units,
ErrorEstimate[] errors,
float[][] newValues)
|
DataShadow |
computeRanges(ShadowType type,
DataShadow shadow)
Recursive version of computeRanges(), called down through Data object tree. |
Field |
convertToField()
convert this FlatField to a (non-Flat) FieldImpl |
Data |
derivative(int error_mode)
return the tuple of derivatives of this Function with respect to all RealType components of its domain RealTuple; propogate errors according to error_mode |
Data |
derivative(MathType[] derivType_s,
int error_mode)
return the tuple of derivatives of this Function with respect to all RealType components of its domain RealTuple; set result MathTypes of tuple components to derivType_s; propogate errors according to error_mode |
Data |
derivative(RealTuple location,
RealType[] d_partial_s,
MathType[] derivType_s,
int error_mode)
return the tuple of derivatives of this Function with respect to the RealTypes in d_partial_s; the RealTypes in d_partial_s may occur in this Function's domain RealTupleType, or, if the domain has a CoordinateSystem, in its Reference RealTupleType; set result MathTypes of tuple components to derivType_s; propogate errors according to error_mode |
Function |
derivative(RealType d_partial,
int error_mode)
return the derivative of this Function with respect to d_partial; d_partial may occur in this Function's domain RealTupleType, or, if the domain has a CoordinateSystem, in its Reference RealTupleType; propogate errors according to error_mode |
Function |
derivative(RealType d_partial,
MathType derivType,
int error_mode)
return the derivative of this Function with respect to d_partial; set result MathType to derivType; d_partial may occur in this Function's domain RealTupleType, or, if the domain has a CoordinateSystem, in its Reference RealTupleType; propogate errors according to error_mode |
boolean |
equals(Object obj)
|
Field |
extract(int component)
extract field from this[].component; this is OK, when we get around to it |
Field |
extract(int component,
boolean copy)
extract field from this[].component; this is OK, when we get around to it |
static void |
fillField(FlatField image,
double step,
double half)
|
Unit[] |
getDefaultRangeUnits()
Get default range Unit-s for 'Flat' components. |
float[][] |
getFloats()
Returns the range values in their default units as floats. |
float[][] |
getFloats(boolean copy)
Returns the range values in their default units as floats. |
CoordinateSystem[] |
getRangeCoordinateSystem()
Returns the range CoordinateSystem assuming that the range type is a RealTupleType (and throws a TypeException if its not). |
CoordinateSystem[] |
getRangeCoordinateSystem(int i)
Returns the CoordinateSystem of a component of the range. |
int |
getRangeDimension()
Gets the number of components in the "flat" range. |
ErrorEstimate[] |
getRangeErrors()
return array of ErrorEstimates associated with each RealType component of range; each ErrorEstimate is a mean error for all samples of a range RealType component |
Set[] |
getRangeSets()
Returns the sampling set of each flat component. |
Unit[][] |
getRangeUnits()
return array of Units associated with each RealType component of range; these may differ from default Units of range RealTypes, but must be convertable; the second index has length = 1 (since all samples have the same Units) |
Data |
getSample(int index)
Get the range value at the index-th sample. |
Data |
getSample(int index,
boolean metadataOnly)
A stub routine which simply invokes getSample to override
FieldImpl.getSample |
String[][] |
getStringValues()
Get String values for Text components |
double[][] |
getValues()
Returns the range values in their default units as doubles. |
double[][] |
getValues(boolean copy)
Returns the range values in their default units as doubles. |
double[] |
getValues(int s_index)
Get values for 'Flat' components in default range Unit-s. |
byte[][] |
grabBytes()
|
boolean |
isFlatField()
return true if this a FlatField or a RemoteField adapting a FlatField |
boolean |
isMissing()
Test whether range values are missing |
String |
longString(String pre)
|
static void |
main(String[] args)
run 'java visad.FlatField' to test the FlatField class |
static FlatField |
makeField(FunctionType type,
int length,
boolean irregular)
construct a FlatField of given type; used for testing |
static FlatField |
makeField1(FunctionType type,
double first1,
double last1,
int length1,
double first2,
double last2,
int length2)
construct a FlatField with a 2-D domain and a 1-D range; used for testing |
static FlatField |
makeField2(FunctionType type,
double first1,
double last1,
int length1,
double first2,
double last2,
int length2)
construct a FlatField with a 2-D domain and a 2-D range; used for testing |
protected static void |
makeRational(double[][] values,
Unit[] units,
ErrorEstimate[] errors)
Ensure that numeric values and units are in rational form, i.e. one in which ratios of data values make sense (e.g. |
protected static void |
makeRational(float[][] values,
Unit[] units,
ErrorEstimate[] errors)
|
protected void |
nullRanges()
Sets various arrays of range values to missing. |
protected void |
pr(String message)
|
Field |
resample(Set set,
int sampling_mode,
int error_mode)
Resamples the range to domain samples of a given set. |
Field |
resampleDouble(Set set,
int sampling_mode,
int error_mode)
Resamples the range to domain samples of a given double set. |
void |
setRangeErrors(ErrorEstimate[] errors)
Sets the ErrorEstimates associated with each RealType component of the range. |
void |
setSample(int index,
Data range)
Set the range value at the index-th sample |
void |
setSample(int index,
Data range,
boolean copy)
Set the range value at the index-th sample |
void |
setSamples(Data[] range,
boolean copy)
set the range values of the function; the order of range values must be the same as the order of domain indices in the DomainSet; copy argument included for consistency with Field, but ignored |
void |
setSamples(double[][] range)
set range array as range values of this FlatField; the array is dimensioned double[number_of_range_components][number_of_range_samples]; the order of range values must be the same as the order of domain indices in the DomainSet |
void |
setSamples(double[][] range,
boolean copy)
set range array as range values of this FlatField; the array is dimensioned double[number_of_range_components][number_of_range_samples]; the order of range values must be the same as the order of domain indices in the DomainSet; copy array if copy flag is true |
void |
setSamples(double[][] range,
ErrorEstimate[] errors,
boolean copy)
set the range values of the function including ErrorEstimate-s; the order of range values must be the same as the order of domain indices in the DomainSet |
void |
setSamples(float[][] range)
set range array as range values of this FlatField; the array is dimensioned float[number_of_range_components][number_of_range_samples]; the order of range values must be the same as the order of domain indices in the DomainSet |
void |
setSamples(float[][] range,
boolean copy)
set range array as range values of this FlatField; the array is dimensioned float[number_of_range_components][number_of_range_samples]; the order of range values must be the same as the order of domain indices in the DomainSet; copy array if copy flag is true |
void |
setSamples(float[][] range,
ErrorEstimate[] errors,
boolean copy)
set the range values of the function including ErrorEstimate-s; the order of range values must be the same as the order of domain indices in the DomainSet |
void |
setSamples(int[] indices,
double[][] range)
|
void |
setSamples(int start,
double[][] range)
update a subset of a FlatField's range samples, where start is the index of the first sample to update and range[0].length is the number of samples to update; the array is dimensioned double[number_of_range_components][number_of_range_samples] |
String |
toString()
|
Data |
unary(int op,
MathType new_type,
int sampling_mode,
int error_mode)
Return new FlatField with value 'this op'. |
float[][] |
unpackFloats()
unpack an array of floats from field sample values according to the RangeSet-s; returns a copy |
protected float[][] |
unpackFloats(boolean copy)
unpack an array of floats from field sample values according to the RangeSet-s; returns a copy if copy == true |
protected float[] |
unpackFloats(int s_index)
Unpack the floats at the sample index. |
protected float[] |
unpackOneFloatRangeComp(int comp)
Unpack one range component, makes a copy. |
protected float[] |
unpackOneFloatRangeComp(int comp,
boolean copy)
Unpack one range component. |
protected double[] |
unpackOneRangeComp(int comp)
Unpack one range component, makes a copy. |
protected double[] |
unpackOneRangeComp(int comp,
boolean copy)
Unpack one range component. |
double[][] |
unpackValues()
unpack an array of doubles from field sample values according to the RangeSet-s; returns a copy |
protected double[][] |
unpackValues(boolean copy)
Unpacks an array of doubles from field sample values according to the RangeSet-s; returns a copy if copy == true. |
protected double[] |
unpackValues(int s_index)
Unpack the double value at the sample index. |
Methods inherited from class visad.FieldImpl |
---|
__getitem__, __len__, __setitem__, __setitem__, combine, combine, combine, combine, combine, domainEnumeration, domainFactor, domainFactor, domainMultiply, domainMultiply, domainMultiply, domainMultiply, extract, extract, getDomainCoordinateSystem, getDomainSet, getDomainUnits, getLength, setSample, setSample, setSample, setSamples |
Methods inherited from class visad.FunctionImpl |
---|
__getitem__, __getitem__, evaluate, evaluate, evaluate, evaluate, getDomainDimension, resample |
Methods inherited from class visad.DataImpl |
---|
__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, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, 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, unary |
Methods inherited from class visad.ThingImpl |
---|
addReference, removeReference |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface visad.Field |
---|
domainEnumeration, domainFactor, domainMultiply, domainMultiply, getDomainSet, getLength, setSample, setSample |
Methods inherited from interface visad.Function |
---|
evaluate, evaluate, evaluate, evaluate, getDomainCoordinateSystem, getDomainDimension, getDomainUnits, resample |
Methods inherited from interface visad.Data |
---|
abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, 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 |
Methods inherited from interface visad.Thing |
---|
addReference, removeReference |
Field Detail |
---|
protected int TupleDimension
protected CoordinateSystem RangeCoordinateSystem
protected CoordinateSystem[] RangeCoordinateSystems
protected Unit[] RangeUnits
Constructor Detail |
---|
public FlatField(FunctionType type) throws VisADException
type
- The type of the function.
VisADException
- Couldn't create necessary VisAD object.public FlatField(FunctionType type, Set domain_set) throws VisADException
type
- The type of the function.domain_set
- The sampling set of the domain. May be
null
, in which case the sampling set is
the default Set of the function domain.
VisADException
- Couldn't create necessary VisAD object.public FlatField(FunctionType type, Set domain_set, CoordinateSystem range_coord_sys, Set[] range_sets, Unit[] units) throws VisADException
type
- The type of the function.domain_set
- The sampling set of the domain. May be
null
, in which case the
sampling set is set to the default sampling
set of the function domain (i.e.
type.getDomain().getDefaultSet()
).range_coord_sys
- Optional coordinate system for the range.
May be null
. If non-null
, then the range of the function shall
be a RealTuple (i.e. type.getRange()
instanceof RealTuple
shall be
true) and the reference coordinate system
of the range coordinate system shall be
the same as the reference coordiinate
system of the function range (i.e.
range_coord_sys().getReference().equals(
((RealTuple)type.getRange()).getReference())
shall be true).range_sets
- The sampling sets of the (flat) range
components. May be null
, in which
case the default sampling sets of the range
component RealType-s are used (i.e.
((RealType)type.getFlatRange().getComponent(i))
.getDefaultSet()
for all i
in the flat range). If non-null
,
then the i
th flat range
component values are stored in bytes
if range_sets[i].getLength() <
256
, stored in shorts if
range_sets[i].getLength() < 65536
, etc.units
- The units of the (flat) range components. May
be null
, in which case the default
units of the flat range RealType-s are used.
VisADException
- Couldn't create necessary VisAD object.public FlatField(FunctionType type, Set domain_set, CoordinateSystem[] range_coord_syses, Set[] range_sets, Unit[] units) throws VisADException
type
- The type of the function.domain_set
- The sampling set of the domain. May be null, in
which case the sampling set is set to the
default sampling set of the function domain
(i.e.
type.getDomain().getDefaultSet()
).range_coord_syses
- Optional coordinate systems for the range
components. May be null
.
If the i
th component
of the range is a RealTuple, then
range_coord_syses[i]
may be
non-null
and, if so, is the
coordinate system for that component and shall
have the same reference coordinate system as
the corresponding component in the range of the
function type.range_sets
- The sampling sets of the (flat) range
components. May be null
, in which
case the default sampling sets of the range
component RealType-s are used (i.e.
((RealType)type.getFlatRange().getComponent(i))
.getDefaultSet()
for all i
in the flat range). If non-null
,
then the i
th flat range
component values are stored in bytes
if range_sets[i].getLength() <
256
, stored in shorts if
range_sets[i].getLength() < 65536
, etc.units
- The units of the (flat) range components. May
be null
, in which case the default
units of the flat range RealType-s are used.
VisADException
- Couldn't create necessary VisAD object.public FlatField(FunctionType type, Set domain_set, CoordinateSystem range_coord_sys, CoordinateSystem[] range_coord_syses, Set[] range_sets, Unit[] units) throws VisADException
type
- The type of the function.domain_set
- The sampling set of the domain. May be null, in
which case the sampling set is set to the
default sampling set of the function domain
(i.e.
type.getDomain().getDefaultSet()
).range_coord_sys
- Optional coordinate system for the range.
May be null
. If non-null
, then the range of the function shall
be a RealTuple (i.e. type.getRange()
instanceof RealTuple
shall be
true) and the reference coordinate system
of the range coordinate system shall be
the same as the reference coordiinate
system of the function range (i.e.
range_coord_sys().getReference().equals(
((RealTuple)type.getRange()).getReference())
shall be true).range_coord_syses
- Optional coordinate systems for the range
components. May be null
.
If the i
th component
of the range is a RealTuple, then
range_coord_syses[i]
may be
non-null
and, if so, is the
coordinate system for that component and shall
have the same reference coordinate system as
the corresponding component in the range of the
function type.range_sets
- The sampling sets of the (flat) range
components. May be null
, in which
case the default sampling sets of the range
component RealType-s are used (i.e.
((RealType)type.getFlatRange().getComponent(i))
.getDefaultSet()
for all i
in the flat range). If non-null
,
then the i
th flat range
component values are stored in bytes
if range_sets[i].getLength() <
256
, stored in shorts if
range_sets[i].getLength() < 65536
, etc.units
- The units of the (flat) range components. May
be null
, in which case the default
units of the flat range RealType-s are used.
SetException
- if range_sets
is non-null
and either one of its elements is
null
or an element's dimension is
not one.
VisADException
- Couldn't create necessary VisAD object.Method Detail |
---|
public CoordinateSystem[] getRangeCoordinateSystem() throws TypeException
getRangeCoordinateSystem
in interface Field
getRangeCoordinateSystem
in class FieldImpl
null
and will be of
length 1.
TypeException
- The type of the range is neither RealType nor
RealTupleType.public Set[] getRangeSets()
getRangeSets
in interface FlatFieldIface
public CoordinateSystem[] getRangeCoordinateSystem(int i) throws TypeException
getRangeCoordinateSystem
in interface Field
getRangeCoordinateSystem
in class FieldImpl
i
- The index of the component. The value shall be
greater than or equal to zero and less that the
number of components in the TupleType of the
range.
i
-th
component. Won't be null
and will
be of length 1. The single element might be
null
.
TypeException
- The type of the range is either RealType or
RealTupleType.public Unit[][] getRangeUnits()
getRangeUnits
in interface Field
getRangeUnits
in class FieldImpl
public ErrorEstimate[] getRangeErrors()
getRangeErrors
in interface FlatFieldIface
public void setRangeErrors(ErrorEstimate[] errors) throws FieldException
errors[i]
is the ErrorEstimate
for the
i
-th RealType
component.
setRangeErrors
in interface FlatFieldIface
errors
- The error estimates for the range values.
FieldException
- if errors
is non-null
and
errors.length != getRangeDimension()
.public void setSamples(Data[] range, boolean copy) throws VisADException, RemoteException
setSamples
in interface Field
setSamples
in class FieldImpl
range
- The range valuescopy
- should the range values be copied
VisADException
RemoteException
public void setSamples(double[][] range) throws VisADException, RemoteException
setSamples
in interface Field
setSamples
in class FieldImpl
VisADException
RemoteException
public void setSamples(float[][] range) throws VisADException, RemoteException
setSamples
in interface Field
setSamples
in class FieldImpl
VisADException
RemoteException
public void setSamples(double[][] range, boolean copy) throws VisADException, RemoteException
setSamples
in interface FlatFieldIface
VisADException
RemoteException
public void setSamples(float[][] range, boolean copy) throws VisADException, RemoteException
setSamples
in interface FlatFieldIface
VisADException
RemoteException
public void setSamples(double[][] range, ErrorEstimate[] errors, boolean copy) throws VisADException, RemoteException
setSamples
in interface FlatFieldIface
VisADException
RemoteException
public void setSamples(int start, double[][] range) throws VisADException, RemoteException
setSamples
in interface FlatFieldIface
VisADException
RemoteException
public void setSamples(int[] indices, double[][] range) throws VisADException, RemoteException
VisADException
RemoteException
public void setSamples(float[][] range, ErrorEstimate[] errors, boolean copy) throws VisADException, RemoteException
setSamples
in interface FlatFieldIface
VisADException
RemoteException
protected void pr(String message)
public byte[][] grabBytes()
grabBytes
in interface FlatFieldIface
public double[][] unpackValues() throws VisADException
VisADException
protected double[][] unpackValues(boolean copy) throws SetException, VisADException
copy
- Whether or not to return a copy.
SetException
- if an element of RangeMode
contains an
unknown value.
VisADException
- if Set.indexToValue(int [])
on a range set
fails.public float[][] unpackFloats() throws VisADException
VisADException
protected float[][] unpackFloats(boolean copy) throws VisADException
VisADException
protected double[] unpackOneRangeComp(int comp) throws VisADException
comp
- component index
VisADException
- bad range modeprotected double[] unpackOneRangeComp(int comp, boolean copy) throws VisADException
comp
- component indexcopy
- true to make a copy
VisADException
- bad range modeprotected float[] unpackOneFloatRangeComp(int comp) throws VisADException
comp
- component index
VisADException
- bad range modeprotected float[] unpackOneFloatRangeComp(int comp, boolean copy) throws VisADException
comp
- component indexcopy
- true to make a copy
VisADException
- bad range modeprotected double[] unpackValues(int s_index) throws VisADException
s_index
- sample index
VisADException
- unable to unpack valuesprotected float[] unpackFloats(int s_index) throws VisADException
s_index
- sample index
VisADException
- unable to unpack floatspublic float[][] getFloats() throws VisADException
getFloats
in interface Field
getFloats
in class FieldImpl
MathType
of
the range. Element [i][j]
is
the j
th sample value of the
i
th component of the range.
VisADException
- if a VisAD object couldn't be created.public float[][] getFloats(boolean copy) throws VisADException
getFloats
in interface Field
getFloats
in class FieldImpl
copy
- Whether or not the returned array might be the
actual range array. If true
, then
the returned array will not be the actual range
array.
MathType
of
the range. Element [i][j]
is
the j
th sample value of the
i
th component of the range.
VisADException
- if a VisAD object couldn't be created.public double[][] getValues() throws VisADException
getValues
in interface Field
getValues
in class FieldImpl
MathType
of
the range. Element [i][j]
is
the j
th sample value of the
i
th component of the range.
VisADException
- if a VisAD object couldn't be created.public double[][] getValues(boolean copy) throws VisADException
getValues
in interface Field
getValues
in class FieldImpl
copy
- Whether or not the returned array might be the
actual range array. If true
, then
the returned array will not be the actual range
array.
MathType
of
the range. Element [i][j]
is
the j
th sample value of the
i
th component of the range.
VisADException
- if a VisAD object couldn't be created.public String[][] getStringValues() throws VisADException, RemoteException
getStringValues
in interface Field
getStringValues
in class FieldImpl
VisADException
- but doesn't happen
RemoteException
- but doesn't happenpublic double[] getValues(int s_index) throws VisADException
getValues
in interface FlatFieldIface
MathType
of
the range. Element [i]
is
the value of the i
th component
of the flattened range.
VisADException
- if a VisAD object couldn't be created.public Unit[] getDefaultRangeUnits()
getDefaultRangeUnits
in interface Field
getDefaultRangeUnits
in class FieldImpl
public Data getSample(int index) throws VisADException, RemoteException
getSample
in interface Field
getSample
in class FieldImpl
index
- index of requested range sample
VisADException
- problem getting data
RemoteException
- problem getting data from remote objectpublic Data getSample(int index, boolean metadataOnly) throws VisADException, RemoteException
getSample
to override
FieldImpl.getSample
getSample
in class FieldImpl
index
- index of requested range samplemetadataOnly
- true if only the metadata is needed,
false if both metadata and data are
desired.
VisADException
- if a VisAD object couldn't be created.
RemoteException
- if the Remote object couldn't be created.public void setSample(int index, Data range, boolean copy) throws VisADException, RemoteException
setSample
in interface Field
setSample
in class FieldImpl
index
- index to setrange
- range value to setcopy
- flag to copy values - meaningless for FlatField
VisADException
- if range's MathType is incompatible or
some other error.
RemoteException
- if the Remote object couldn't be created.public void setSample(int index, Data range) throws VisADException, RemoteException
setSample
in interface Field
setSample
in class FieldImpl
index
- index to setrange
- range value to set
VisADException
- if range's MathType is incompatible or
some other error.
RemoteException
- if the Remote object couldn't be created.protected void nullRanges() throws VisADException
VisADException
- if a Set.getLength()
invocation on a range
set fails.public boolean isMissing()
isMissing
in interface Data
isMissing
in class FieldImpl
public void clearMissing()
clearMissing
in interface FlatFieldIface
public Data binary(Data data, int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException, RemoteException
binary
in interface Data
binary
in class FieldImpl
data
- object to operate onop
- operation to perform (e.g. ADD, SUB, MULT)new_type
- MathType of new objectsampling_mode
- sampling mode to use
(e.g., NEAREST_NEIGHBOR, WEIGHTED_AVERAGE)error_mode
- error estimate mode (e.g., NO_ERROR, DEPENDENT,
independent)
VisADException
- couldn't create new VisAD object
RemoteException
- couldn't create new Remote objectpublic Data unary(int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException
unary
in interface Data
unary
in class FieldImpl
op
- operation to perform (e.g., NOP, ABS, COS)new_type
- MathType of new objectsampling_mode
- sampling mode to use
(e.g., NEAREST_NEIGHBOR, WEIGHTED_AVERAGE)error_mode
- error estimate mode (e.g., NO_ERROR, DEPENDENT,
independent)
VisADException
- couldn't create new VisAD object
RemoteException
- couldn't create new Remote objectprotected static void makeRational(double[][] values, Unit[] units, ErrorEstimate[] errors) throws UnitException
values
- The numeric values. On output,
values[i]
will have been replaced
if necessary.units
- The units for the values and error estimates.
It's length shall be values.length
.
On output, units[i]
will have been
replaced with the absolute form of the input
unit if necessary.errors
- The error estimates. It's length shall be
values.length
. On output,
errors[i]
will have been replaced
if necessary.
UnitException
- Unit conversion error.protected static void makeRational(float[][] values, Unit[] units, ErrorEstimate[] errors) throws UnitException
UnitException
public Field extract(int component) throws VisADException, RemoteException
extract
in interface Field
extract
in class FieldImpl
VisADException
RemoteException
public Field extract(int component, boolean copy) throws VisADException, RemoteException
VisADException
RemoteException
public Data derivative(RealTuple location, RealType[] d_partial_s, MathType[] derivType_s, int error_mode) throws VisADException, RemoteException
Function
derivative
in interface Function
derivative
in class FieldImpl
VisADException
RemoteException
public Data derivative(int error_mode) throws VisADException, RemoteException
Function
derivative
in interface Function
derivative
in class FieldImpl
VisADException
RemoteException
public Data derivative(MathType[] derivType_s, int error_mode) throws VisADException, RemoteException
Function
derivative
in interface Function
derivative
in class FieldImpl
VisADException
RemoteException
public Function derivative(RealType d_partial, int error_mode) throws VisADException, RemoteException
Function
derivative
in interface Function
derivative
in class FieldImpl
VisADException
RemoteException
public Function derivative(RealType d_partial, MathType derivType, int error_mode) throws VisADException, RemoteException
Function
derivative
in interface Function
derivative
in class FieldImpl
VisADException
RemoteException
public Field resample(Set set, int sampling_mode, int error_mode) throws VisADException, RemoteException
resample
in interface Function
resample
in class FieldImpl
set
- The set of points at which to resample this
field.sampling_mode
- Resampling mode: Data.NEAREST_NEIGHBOR or
Data.WEIGHTED_AVERAGEerror_mode
- Error estimation mode: Data.DEPENDENT,
Data.INDEPENDENT, or Data.NO_ERRORS.
VisADException
- unable to resample function
RemoteException
- Java RMI exceptionpublic Field resampleDouble(Set set, int sampling_mode, int error_mode) throws VisADException, RemoteException
resampleDouble
in class FieldImpl
set
- The set of points at which to resample this
field.sampling_mode
- Resampling mode: Data.NEAREST_NEIGHBOR or
Data.WEIGHTED_AVERAGEerror_mode
- Error estimation mode: Data.DEPENDENT,
Data.INDEPENDENT, or Data.NO_ERRORS.
VisADException
- unable to resample function
RemoteException
- Java RMI exceptionpublic Field convertToField() throws VisADException, RemoteException
convertToField
in interface FlatFieldIface
VisADException
RemoteException
public DataShadow computeRanges(ShadowType type, DataShadow shadow) throws VisADException
Data
computeRanges
in interface Data
computeRanges
in class FieldImpl
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 value
VisADException
- a VisAD error occurredpublic Data adjustSamplingError(Data error, int error_mode) throws VisADException, RemoteException
adjustSamplingError
in interface Data
adjustSamplingError
in class FieldImpl
error_mode
- may be Data.INDEPENDENT, Data.DEPENDENT or
Data.NO_ERRORS;
VisADException
- a VisAD error occurred
RemoteException
- an RMI error occurredpublic boolean isFlatField()
Field
isFlatField
in interface Field
isFlatField
in class FieldImpl
protected FlatField cloneDouble(MathType f_type, Unit[] units, ErrorEstimate[] errors) throws VisADException
VisADException
protected FlatField cloneDouble(MathType f_type, Unit[] units, ErrorEstimate[] errors, double[][] newValues) throws VisADException
VisADException
protected FlatField cloneFloat(MathType f_type, Unit[] units, ErrorEstimate[] errors) throws VisADException
VisADException
protected FlatField cloneFloat(MathType f_type, Unit[] units, ErrorEstimate[] errors, float[][] newValues) throws VisADException
VisADException
public Object clone()
Note that it is possible to simultaneously modify the domain-set of
both this instance and the clone by modifying the values in the array
returned by invoking getSamples(false)
on the domain-set of
either this instance or the clone. Don't do this unless you enjoy
debugging.
clone
in class FieldImpl
RuntimeException
- if a VisADException
occurs.public String toString()
toString
in class DataImpl
public String longString(String pre) throws VisADException
longString
in interface Data
longString
in class FieldImpl
pre
- String added to start of each line
VisADException
public int getRangeDimension()
getRangeDimension
in interface FlatFieldIface
public boolean equals(Object obj)
equals
in class FieldImpl
public static FlatField makeField(FunctionType type, int length, boolean irregular) throws VisADException, RemoteException
VisADException
RemoteException
public static void fillField(FlatField image, double step, double half) throws VisADException, RemoteException
VisADException
RemoteException
public static FlatField makeField1(FunctionType type, double first1, double last1, int length1, double first2, double last2, int length2) throws VisADException, RemoteException
VisADException
RemoteException
public static FlatField makeField2(FunctionType type, double first1, double last1, int length1, double first2, double last2, int length2) throws VisADException, RemoteException
VisADException
RemoteException
public static void main(String[] args) throws VisADException, RemoteException
VisADException
RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |