|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.CoordinateSystem visad.EmpiricalCoordinateSystem
public final class EmpiricalCoordinateSystem
Provides support for empirically-defined CoordinateSystem-s. This is useful for data-dependent coordinate transformations that must be determined empirically rather than analytically (e.g. pressure <-> height).
Coordinates in this system are termed "world" coordinates and coordinates in the reference coordinate system are termed "reference" coordinates.
Instances of this class are immutable.
Constructor Summary | |
---|---|
EmpiricalCoordinateSystem(GriddedSet world,
GriddedSet reference)
Constructs from two GriddedSet-s. |
|
EmpiricalCoordinateSystem(GriddedSet world,
GriddedSet reference,
boolean copy,
boolean check)
Constructs from two GriddedSet-s. |
Method Summary | |
---|---|
static EmpiricalCoordinateSystem |
create(Field field)
Constructs an EmpiricalCoordinateSystem from a Field. |
protected static GriddedSet |
ensureNoCoordinateSystem(GriddedSet griddedSet)
Ensures that a GriddedSet doesn't have a default CoordinateSystem. |
protected static GriddedSet |
ensureNoCoordinateSystem(GriddedSet griddedSet,
boolean copy,
boolean check)
Ensures that a GriddedSet doesn't have a default CoordinateSystem. |
boolean |
equals(Object object)
Indicates if this coordinate system is semantically identical to an object. |
double[][] |
fromReference(double[][] values)
Converts reference coordinates to world coordinates. |
float[][] |
fromReference(float[][] values)
Converts reference coordinates to world coordinates. |
GriddedSet |
getReferenceSet()
Returns the Set of reference coordinates. |
GriddedSet |
getWorldSet()
Returns the Set of world coordinates. |
static EmpiricalCoordinateSystem |
inverseCreate(Field field)
Constructs an EmpiricalCoordinateSystem from a Field. |
double[][] |
toReference(double[][] values)
Convert world coordinates to reference coordinates. |
float[][] |
toReference(float[][] values)
Convert world coordinates to reference coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EmpiricalCoordinateSystem(GriddedSet world, GriddedSet reference) throws VisADException
world
- A set of world coordinates.
world.getLengths()
shall equal
reference.getLengths()
. Determines
the default units of world coordinates:
the default units will be those of
world.getSetUnits()
.reference
- A set of reference coordinates. Determines
the reference RealTupleType.
VisADException
- Couldn't create necessary VisAD object.public EmpiricalCoordinateSystem(GriddedSet world, GriddedSet reference, boolean copy, boolean check) throws VisADException
world
- A set of world coordinates.
world.getLengths()
shall equal
reference.getLengths()
. Determines
the default units of world coordinates:
the default units will be those of
world.getSetUnits()
.reference
- A set of reference coordinates. Determines
the reference RealTupleType.copy
- copy samples if clone is madecheck
- check whether samples form a valid grid
VisADException
- Couldn't create necessary VisAD object.Method Detail |
---|
protected static GriddedSet ensureNoCoordinateSystem(GriddedSet griddedSet) throws VisADException
griddedSet
- The GriddedSet to not have a CoordinateSystem.
VisADException
- Couldn't create necessary VisAD object.protected static GriddedSet ensureNoCoordinateSystem(GriddedSet griddedSet, boolean copy, boolean check) throws VisADException
griddedSet
- The GriddedSet to not have a CoordinateSystem.
VisADException
- Couldn't create necessary VisAD object.public static EmpiricalCoordinateSystem create(Field field) throws SetException, VisADException, RemoteException
toReference()
method of the resulting CoordinateSystem will
transform numeric values in actual units of the domain of the field to
numeric values in default units of the range of the field. Similarly,
the fromReference()
method will transform numeric values in
default units of the range of the field to numeric values in the actual
units of the domain of the field.
field
- The FlatField comprising a coordinate system
transformation from the domain to the range.
The rank of the domain and range shall be the
same. The domain set of the field shall be a
GriddedSet.
SetException
- The field's domain set isn't a GriddedSet.
VisADException
- Couldn't create necessary VisAD object.
RemoteException
- Java RMI failure.public static EmpiricalCoordinateSystem inverseCreate(Field field) throws SetException, VisADException, RemoteException
toReference()
method of the resulting CoordinateSystem will
transform numeric values in actual units of the range of the field to
numeric values in default units of the domain of the field. Similarly,
the fromReference()
method will transform numeric values in
default units of the domain of the field to numeric values in the actual
units of the range of the field. The coordinate system transformation
created by this method is the inverse of that created by create(Field)
.
field
- The FlatField comprising a coordinate system
transformation from the range to the domain.
The rank of the domain and range shall be the
same. The domain set of the field shall be a
GriddedSet.
SetException
- The field's domain set isn't a GriddedSet.
VisADException
- Couldn't create necessary VisAD object.
RemoteException
- Java RMI failure.public GriddedSet getWorldSet()
public GriddedSet getReferenceSet()
public double[][] fromReference(double[][] values) throws SetException, VisADException
fromReference
in class CoordinateSystem
values
- Numeric reference coordinates in default units
of the reference RealTupleType to be
converted to numeric world coordinates.
values.length
shall
equal getDimension()
and
values[i].length
shall be the same
for all i
.
values
which now contains
world coordinates. Values which could
not be converted will have the value
Double.NaN
.
SetException
- Mismatch between input values and field domain.
VisADException
- Couldn't create necessary VisAD object.public double[][] toReference(double[][] values) throws SetException, VisADException
toReference
in class CoordinateSystem
values
- Numeric world coordinates to be converted
to numeric reference coordinates in default
units of the reference RealTupleType.
values.length
shall
equal getDimension()
and
values[i].length
shall be the same
for all i
.
values
which now contains
world coordinates. Values which could
not be converted will have the value
Double.NaN
.
SetException
- Mismatch between input values and field domain.
VisADException
- Couldn't create necessary VisAD object.public float[][] fromReference(float[][] values) throws SetException, VisADException
fromReference
in class CoordinateSystem
values
- Numeric reference coordinates in default units
of the reference RealTupleType to be
converted to numeric world coordinates.
values.length
shall
equal getDimension()
and
values[i].length
shall be the same
for all i
.
values
which now contains
world coordinates. Values which could
not be converted will have the value
Double.NaN
.
SetException
- Mismatch between input values and field domain.
VisADException
- Couldn't create necessary VisAD object.public float[][] toReference(float[][] values) throws SetException, VisADException
toReference
in class CoordinateSystem
values
- Numeric world coordinates to be converted
to numeric reference coordinates in default
units of the reference RealTupleType.
values.length
shall
equal getDimension()
and
values[i].length
shall be the same
for all i
.
values
which now contains
world coordinates. Values which could
not be converted will have the value
Double.NaN
.
SetException
- Mismatch between input values and field domain.
VisADException
- Couldn't create necessary VisAD object.public boolean equals(Object object)
equals
in class CoordinateSystem
object
- The object in question.
true
if and only if this
coordinate system is semantically identical to
object
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |