|
||||||||||
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 visad.meteorology.SingleBandedImageImpl visad.meteorology.SatelliteImage visad.data.AreaImageCacheAdapter
public class AreaImageCacheAdapter
Adapts a FlatField
backed by a AreaImageAccessor
to work
with a FlatFieldCache
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class visad.DataImpl |
---|
DataImpl.Syncher |
Field Summary |
---|
Fields inherited from class visad.FlatField |
---|
RangeCoordinateSystem, RangeCoordinateSystems, RangeUnits, 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 | |
---|---|
AreaImageCacheAdapter(SatelliteImage template,
AreaImageAccessor accessor,
FlatFieldCache cache)
|
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,
int sampling_mode,
int error_mode)
Return the result of a binary operation between this instance and another operand. |
Data |
binary(Data data,
int op,
MathType new_type,
int sampling_mode,
int error_mode)
Return new Field with value 'this op data'. |
Object |
clone()
Clones this instance. |
DataShadow |
computeRanges(ShadowType type,
DataShadow shadow)
Recursive version of computeRanges(), called down through Data object tree. |
Field |
domainFactor(RealType factor)
Factors this instance into a (nested) field-of-fields. |
Field |
extract(int component)
extract field from this[].component; this is OK, when we get around to it |
protected SatelliteImage |
getAdaptedFlatField()
|
Unit[] |
getDefaultRangeUnits()
Get default range Unit-s for 'Flat' components. |
CoordinateSystem |
getDomainCoordinateSystem()
Get the CoordinateSystem associated with the domain RealTuple |
Set |
getDomainSet()
Returns the domain-set of this instance. |
Unit[] |
getDomainUnits()
Returns the units of the values in the domain set. |
float[][] |
getFloats(boolean copy)
Returns the range values in their default units as floats. |
String |
getId()
|
int |
getLength()
get number of samples |
static Set |
getNullDomainSet(RealTupleType type)
|
CoordinateSystem[] |
getRangeCoordinateSystem()
Returns the range CoordinateSystem assuming that the range type is a RealTupleType (and throws a TypeException if its not). |
CoordinateSystem[] |
getRangeCoordinateSystem(int component)
Returns the CoordinateSystem of a component of the range. |
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. |
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 index)
Get values for 'Flat' components in default range Unit-s. |
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)
|
Field |
resample(Set set,
int sampling_mode,
int error_mode)
Resamples the range to domain samples of a given set. |
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 |
setSample(RealTuple domain,
Data range)
set the range value at the sample nearest to domain |
void |
setSamples(double[][] data)
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,
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. |
String |
toString()
|
Data |
unary(int op,
int sampling_mode,
int error_mode)
Return the result of a unary operation on this instance. |
Data |
unary(int op,
MathType new_type,
int sampling_mode,
int error_mode)
return new SatelliteImage with value 'op this' |
float[][] |
unpackFloats()
unpack an array of floats from field sample values according to the RangeSet-s; returns a copy |
double[][] |
unpackValues()
unpack an array of doubles from field sample values according to the RangeSet-s; returns a copy |
Methods inherited from class visad.meteorology.SatelliteImage |
---|
getSensorName |
Methods inherited from class visad.meteorology.SingleBandedImageImpl |
---|
getDescription, getImageData, getMaxRangeValue, getMinRangeValue, getStartTime, isNavigated, setSamples |
Methods inherited from class visad.FieldImpl |
---|
__getitem__, __len__, __setitem__, __setitem__, combine, combine, combine, combine, combine, domainEnumeration, domainFactor, domainMultiply, domainMultiply, domainMultiply, domainMultiply, extract, extract, 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, 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 |
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.meteorology.SatelliteData |
---|
getDescription |
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, 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 |
Methods inherited from interface visad.Thing |
---|
addReference, removeReference |
Methods inherited from interface visad.Field |
---|
domainEnumeration, domainMultiply, domainMultiply, getFloats, getStringValues, setSample, setSamples, setSamples |
Methods inherited from interface visad.Function |
---|
derivative, derivative, derivative, derivative, derivative, evaluate, evaluate, evaluate, evaluate, getDomainDimension, resample |
Constructor Detail |
---|
public AreaImageCacheAdapter(SatelliteImage template, AreaImageAccessor accessor, FlatFieldCache cache) throws VisADException, RemoteException
VisADException
RemoteException
Method Detail |
---|
public String getId()
public static Set getNullDomainSet(RealTupleType type) throws VisADException
VisADException
protected SatelliteImage getAdaptedFlatField()
public Data getSample(int index) throws VisADException, RemoteException
FlatField
getSample
in interface Field
getSample
in class FlatField
index
- index of requested range sample
VisADException
- problem getting data
RemoteException
- problem getting data from remote objectpublic int getLength()
FieldImpl
getLength
in interface Field
getLength
in class FieldImpl
public Unit[] getDomainUnits()
FieldImpl
getDomainUnits
in interface Function
getDomainUnits
in class FieldImpl
public CoordinateSystem getDomainCoordinateSystem()
FunctionImpl
getDomainCoordinateSystem
in interface Function
getDomainCoordinateSystem
in class FieldImpl
public CoordinateSystem[] getRangeCoordinateSystem() throws TypeException
FlatField
getRangeCoordinateSystem
in interface Field
getRangeCoordinateSystem
in class FlatField
null
and will be of
length 1.
TypeException
- The type of the range is neither RealType nor
RealTupleType.public CoordinateSystem[] getRangeCoordinateSystem(int component) throws TypeException
FlatField
getRangeCoordinateSystem
in interface Field
getRangeCoordinateSystem
in class FlatField
component
- 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()
FlatField
getRangeUnits
in interface Field
getRangeUnits
in class FlatField
public Unit[] getDefaultRangeUnits()
FlatField
getDefaultRangeUnits
in interface Field
getDefaultRangeUnits
in class FlatField
public double[][] getValues() throws VisADException
FlatField
getValues
in interface Field
getValues
in class FlatField
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
FlatField
getValues
in interface Field
getValues
in class FlatField
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(int index) throws VisADException
FlatField
getValues
in interface FlatFieldIface
getValues
in class FlatField
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 float[][] getFloats(boolean copy) throws VisADException
FlatField
getFloats
in interface Field
getFloats
in class FlatField
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 Set getDomainSet()
FieldImpl
Returns the domain-set of this instance. The actual set is returned: it is not a copy or a clone.
Note that it is possible to simultaneously modify the domain-set of
both this instance and of a 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.
getDomainSet
in interface Field
getDomainSet
in class FieldImpl
public void setSample(int index, Data range) throws VisADException, RemoteException
FlatField
setSample
in interface Field
setSample
in class FlatField
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.public void setSample(RealTuple domain, Data range) throws VisADException, RemoteException
Field
setSample
in interface Field
setSample
in class FieldImpl
VisADException
RemoteException
public void setSample(int index, Data range, boolean copy) throws VisADException, RemoteException
FlatField
setSample
in interface Field
setSample
in class FlatField
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 setSamples(double[][] data) throws RemoteException, VisADException
FlatField
setSamples
in interface Field
setSamples
in class FlatField
RemoteException
VisADException
public void setSamples(double[][] range, ErrorEstimate[] errors, boolean copy) throws VisADException, RemoteException
SingleBandedImageImpl
setSamples
in interface FlatFieldIface
setSamples
in class SingleBandedImageImpl
range
- pixel values as doubleserrors
- ErrorEstimates for values (may be null);copy
- flag to make a copy of value array or not
VisADException
- couldn't set values
RemoteException
- couldn't set remote objectpublic boolean isMissing()
FlatField
isMissing
in interface Data
isMissing
in class FlatField
public Data binary(Data data, int op, int sampling_mode, int error_mode) throws VisADException, RemoteException
SingleBandedImageImpl
DataImpl.binary(Data, int, int, int)
method is a
FlatField
from which an object of this class can be constructed,
then this method returns an instance of this class with a description
determined by the input descriptions and the operation and a time equal
to the average times of the input; otherwise, the object resulting from
the FlatField.binary(visad.Data, int, visad.MathType, int, int)
method is returned.
binary
in interface Data
binary
in class SingleBandedImageImpl
data
- The other operand of the operation.op
- The operation to perform (e.g. Data.ADD
, Data.DIVIDE
, etc.).sampling_mode
- The sampling mode. One of Data.NEAREST_NEIGHBOR
or Data.WEIGHTED_AVERAGE
.error_mode
- The error propagation mode. One of Data.NO_ERRORS
, Data.INDEPENDENT
,
or Data.DEPENDENT
.
VisADException
- if a VisAD failure occurs.
RemoteException
- an RMI error occurredpublic Data binary(Data data, int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException, RemoteException
FlatField
binary
in interface Data
binary
in class FlatField
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, int sampling_mode, int error_mode) throws VisADException, RemoteException
SingleBandedImageImpl
DataImpl.unary(int, int, int)
method is a FlatField
from which an object of this class can be constructed,
then this method returns an instance of this class with a description
determined by the input description and the operation and a time equal
to the time of this instance; otherwise, the object resulting from the
FlatField.unary(int, visad.MathType, int, int)
method is returned.
unary
in interface Data
unary
in class SingleBandedImageImpl
op
- The operation to perform (e.g. Data.ABS
, Data.COS
, etc.).sampling_mode
- The sampling mode. One of Data.NEAREST_NEIGHBOR
or Data.WEIGHTED_AVERAGE
.error_mode
- The error propagation mode. One of Data.NO_ERRORS
, Data.INDEPENDENT
,
or Data.DEPENDENT
.
VisADException
- if a VisAD failure occurs.
RemoteException
- an RMI error occurredpublic Data unary(int op, MathType new_type, int sampling_mode, int error_mode) throws VisADException
SatelliteImage
unary
in interface Data
unary
in class SatelliteImage
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 objectpublic double[][] unpackValues() throws VisADException
unpackValues
in class FlatField
VisADException
public float[][] unpackFloats() throws VisADException
unpackFloats
in class FlatField
VisADException
public Field extract(int component) throws VisADException, RemoteException
FlatField
extract
in interface Field
extract
in class FlatField
VisADException
RemoteException
public Field domainFactor(RealType factor) throws VisADException, RemoteException
FieldImpl
domainFactor
in interface Field
domainFactor
in class FieldImpl
factor
- The type of the domain for the outer field.
DomainException
- The domain of this instance cannot be factored
as requested.
VisADException
- VisAD failure.
RemoteException
- Java RMI failure.for copy information
public Field resample(Set set, int sampling_mode, int error_mode) throws VisADException, RemoteException
FlatField
resample
in interface Function
resample
in class FlatField
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 DataShadow computeRanges(ShadowType type, DataShadow shadow) throws VisADException
Data
computeRanges
in interface Data
computeRanges
in class FlatField
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
FlatField
adjustSamplingError
in interface Data
adjustSamplingError
in class FlatField
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 FlatField
public Object clone()
clone()
contract in that the returned object will compare unequal to
this instance. As such, this method should probably not be invoked.
clone
in class FlatField
public String longString(String pre)
longString
in interface Data
longString
in class FlatField
pre
- String added to start of each line
public String toString()
toString
in class FlatField
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |