visad
Class EmpiricalCoordinateSystem
- java.lang.Object
-
- visad.CoordinateSystem
-
- visad.EmpiricalCoordinateSystem
-
- All Implemented Interfaces:
- java.io.Serializable
public final class EmpiricalCoordinateSystem extends CoordinateSystem implements java.io.Serializable
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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static EmpiricalCoordinateSystemcreate(Field field)Constructs an EmpiricalCoordinateSystem from a Field.booleanequals(java.lang.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.GriddedSetgetReferenceSet()Returns the Set of reference coordinates.GriddedSetgetWorldSet()Returns the Set of world coordinates.static EmpiricalCoordinateSysteminverseCreate(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 visad.CoordinateSystem
canConvert, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
-
-
-
-
Constructor Detail
-
EmpiricalCoordinateSystem
public EmpiricalCoordinateSystem(GriddedSet world, GriddedSet reference) throws VisADException
Constructs from two GriddedSet-s. The dimensionality (i.e. rank and lengths) of the two sets must be identical. The RealTupleType of the reference will be that of the reference set. The units of the world coordinates will be the actual units of the world set.- Parameters:
world- A set of world coordinates.world.getLengths()shall equalreference.getLengths(). Determines the default units of world coordinates: the default units will be those ofworld.getSetUnits().reference- A set of reference coordinates. Determines the reference RealTupleType.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
EmpiricalCoordinateSystem
public EmpiricalCoordinateSystem(GriddedSet world, GriddedSet reference, boolean copy, boolean check) throws VisADException
Constructs from two GriddedSet-s. The dimensionality (i.e. rank and lengths) of the two sets must be identical. The RealTupleType of the reference will be that of the reference set. The units of the world coordinates will be the actual units of the world set.- Parameters:
world- A set of world coordinates.world.getLengths()shall equalreference.getLengths(). Determines the default units of world coordinates: the default units will be those ofworld.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- Throws:
VisADException- Couldn't create necessary VisAD object.
-
-
Method Detail
-
create
public static EmpiricalCoordinateSystem create(Field field) throws SetException, VisADException, java.rmi.RemoteException
Constructs an EmpiricalCoordinateSystem from a Field. ThetoReference()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, thefromReference()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.- Parameters:
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.- Throws:
SetException- The field's domain set isn't a GriddedSet.VisADException- Couldn't create necessary VisAD object.java.rmi.RemoteException- Java RMI failure.
-
inverseCreate
public static EmpiricalCoordinateSystem inverseCreate(Field field) throws SetException, VisADException, java.rmi.RemoteException
Constructs an EmpiricalCoordinateSystem from a Field. ThetoReference()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, thefromReference()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 bycreate(Field).- Parameters:
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.- Throws:
SetException- The field's domain set isn't a GriddedSet.VisADException- Couldn't create necessary VisAD object.java.rmi.RemoteException- Java RMI failure.
-
getWorldSet
public GriddedSet getWorldSet()
Returns the Set of world coordinates.- Returns:
- The Set of world coordinates.
-
getReferenceSet
public GriddedSet getReferenceSet()
Returns the Set of reference coordinates.- Returns:
- The Set of reference coordinates.
-
fromReference
public double[][] fromReference(double[][] values) throws SetException, VisADExceptionConverts reference coordinates to world coordinates.- Specified by:
fromReferencein classCoordinateSystem- Parameters:
values- Numeric reference coordinates in default units of the reference RealTupleType to be converted to numeric world coordinates.values.lengthshall equalgetDimension()andvalues[i].lengthshall be the same for alli.- Returns:
valueswhich now contains world coordinates. Values which could not be converted will have the valueDouble.NaN.- Throws:
SetException- Mismatch between input values and field domain.VisADException- Couldn't create necessary VisAD object.
-
toReference
public double[][] toReference(double[][] values) throws SetException, VisADExceptionConvert world coordinates to reference coordinates.- Specified by:
toReferencein classCoordinateSystem- Parameters:
values- Numeric world coordinates to be converted to numeric reference coordinates in default units of the reference RealTupleType.values.lengthshall equalgetDimension()andvalues[i].lengthshall be the same for alli.- Returns:
valueswhich now contains world coordinates. Values which could not be converted will have the valueDouble.NaN.- Throws:
SetException- Mismatch between input values and field domain.VisADException- Couldn't create necessary VisAD object.
-
fromReference
public float[][] fromReference(float[][] values) throws SetException, VisADExceptionConverts reference coordinates to world coordinates.- Overrides:
fromReferencein classCoordinateSystem- Parameters:
values- Numeric reference coordinates in default units of the reference RealTupleType to be converted to numeric world coordinates.values.lengthshall equalgetDimension()andvalues[i].lengthshall be the same for alli.- Returns:
valueswhich now contains world coordinates. Values which could not be converted will have the valueDouble.NaN.- Throws:
SetException- Mismatch between input values and field domain.VisADException- Couldn't create necessary VisAD object.
-
toReference
public float[][] toReference(float[][] values) throws SetException, VisADExceptionConvert world coordinates to reference coordinates.- Overrides:
toReferencein classCoordinateSystem- Parameters:
values- Numeric world coordinates to be converted to numeric reference coordinates in default units of the reference RealTupleType.values.lengthshall equalgetDimension()andvalues[i].lengthshall be the same for alli.- Returns:
valueswhich now contains world coordinates. Values which could not be converted will have the valueDouble.NaN.- Throws:
SetException- Mismatch between input values and field domain.VisADException- Couldn't create necessary VisAD object.
-
equals
public boolean equals(java.lang.Object object)
Indicates if this coordinate system is semantically identical to an object.- Specified by:
equalsin classCoordinateSystem- Parameters:
object- The object in question.- Returns:
trueif and only if this coordinate system is semantically identical toobject.
-
-
DMelt 3.0 © DataMelt by jWork.ORG