Class CartesianProductCoordinateSystem
- java.lang.Object
-
- visad.CoordinateSystem
-
- visad.CartesianProductCoordinateSystem
-
- All Implemented Interfaces:
- java.io.Serializable
public class CartesianProductCoordinateSystem extends CoordinateSystem
A class for creating a new CoordinateSystem that is the product of two or more CoordinateSystems. This is useful for creating a new CoordinateSystem when combining values from different Data objects with different CoordinateSystems into a new Data object with a new CoordinateSystem that combines the CoordinateSystems from the original Data objects. An example would be where one CoordinateSystem transforms (row,col) -> (lat,lon) and another CoordinateSystem transforms (pressure) -> (altitude). The resulting CartesianProductCoordinateSystem would transform (row, col, pressure) -> (lat, lon, alt).
The resulting CartesianProductCoordinateSystem will have a dimension of the sum of the dimensions of the individual CoordinateSystems and a Reference RealTupleType that is the composite of the references of each CoordinateSystem. The CoordinateSystem Units are a composite of the Units of each of the CoordinateSystems as well.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description CartesianProductCoordinateSystem(CoordinateSystem[] csArray)Construct a CartesianProductCoordinateSystem from an array of CoordinateSystems.CartesianProductCoordinateSystem(CoordinateSystem a, CoordinateSystem b)Construct a CartesianProductCoordinateSystem from two other CoordinateSystems.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Check to see if the object in question is equal to this CartesianProductCoordinateSystem.double[][]fromReference(double[][] refTuple)Convert array of reference valeus from Reference coordinates.float[][]fromReference(float[][] refTuple)Convert array of reference valeus from Reference coordinates.CoordinateSystemgetCoordinateSystem(int index)Get a particular CoordinateSystemCoordinateSystem[]getCoordinateSystems()Get the arrays of CoordinateSystems being used in this productdouble[][]toReference(double[][] input)Convert input array to reference coordinates.float[][]toReference(float[][] input)Convert input array 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
-
CartesianProductCoordinateSystem
public CartesianProductCoordinateSystem(CoordinateSystem a, CoordinateSystem b) throws VisADException
Construct a CartesianProductCoordinateSystem from two other CoordinateSystems.- Parameters:
a- first non-null CoordinateSystemb- second non-null CoordinateSystem- Throws:
VisADException- a or b are null or VisAD object can't be created
-
CartesianProductCoordinateSystem
public CartesianProductCoordinateSystem(CoordinateSystem[] csArray) throws VisADException
Construct a CartesianProductCoordinateSystem from an array of CoordinateSystems.- Parameters:
csArray- non-null array of non-null CoordinateSystems- Throws:
VisADException- an element is null or VisAD object can't be created.
-
-
Method Detail
-
getCoordinateSystems
public CoordinateSystem[] getCoordinateSystems()
Get the arrays of CoordinateSystems being used in this product- Returns:
- array of CoordinateSystems
-
getCoordinateSystem
public CoordinateSystem getCoordinateSystem(int index)
Get a particular CoordinateSystem- Parameters:
index- index into the array- Returns:
- CoordinateSystem from array
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (no need to declare) if index out of bounds
-
toReference
public double[][] toReference(double[][] input) throws VisADExceptionConvert input array to reference coordinates.- Specified by:
toReferencein classCoordinateSystem- Parameters:
input- input array- Returns:
- array of values in reference space
- Throws:
VisADException- input array has the wrong dimension or is null
-
fromReference
public double[][] fromReference(double[][] refTuple) throws VisADExceptionConvert array of reference valeus from Reference coordinates. Input values are modified in this transaction.- Specified by:
fromReferencein classCoordinateSystem- Parameters:
refTuple- reference tuple array- Returns:
- array of values in non-reference space
- Throws:
VisADException- input array has the wrong dimension or is null
-
toReference
public float[][] toReference(float[][] input) throws VisADExceptionConvert input array to reference coordinates.- Overrides:
toReferencein classCoordinateSystem- Parameters:
input- input array- Returns:
- array of values in reference space
- Throws:
VisADException- input array has the wrong dimension or is null
-
fromReference
public float[][] fromReference(float[][] refTuple) throws VisADExceptionConvert array of reference valeus from Reference coordinates. Input values are modified in this transaction.- Overrides:
fromReferencein classCoordinateSystem- Parameters:
refTuple- reference tuple array- Returns:
- array of values in non-reference space
- Throws:
VisADException- input array has the wrong dimension or is null
-
equals
public boolean equals(java.lang.Object o)
Check to see if the object in question is equal to this CartesianProductCoordinateSystem.- Specified by:
equalsin classCoordinateSystem- Parameters:
o- object in question- Returns:
- true if the the object in question is composed of equal CoordinateSystems.
-
-
DMelt 3.0 © DataMelt by jWork.ORG