public final class EmpiricalCoordinateSystem extends CoordinateSystem implements Serializable
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 and Description |
---|
EmpiricalCoordinateSystem(GriddedSet world,
GriddedSet reference)
Constructs from two GriddedSet-s.
|
EmpiricalCoordinateSystem(GriddedSet world,
GriddedSet reference,
boolean copy,
boolean check)
Constructs from two GriddedSet-s.
|
Modifier and Type | Method and Description |
---|---|
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.
|
canConvert, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
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 gridVisADException
- Couldn't create necessary VisAD object.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
.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.