Package ucar.unidata.view.sounding
Class EmagramCoordinateSystem
java.lang.Object
visad.CoordinateSystem
ucar.unidata.view.sounding.AerologicalCoordinateSystem
ucar.unidata.view.sounding.EmagramCoordinateSystem
- All Implemented Interfaces:
Serializable
Provides support for converting between the (x,y) coordinates on a skew T - log P diagram and (pressure,temperature) coordinates.
Instances of this class are immutable.
- Version:
- $Revision: 1.2 $ $Date: 2005/05/13 18:33:30 $
- Author:
- Steven R. Emmerson
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCreate a 3D display coordinate system from the (possibly) 2D input.boolean
Indicate whether or not this coordinate system is the same as another.double[][]
fromReference
(double[][] coords) Transforms (X,Y) coordinates to (pressure,temperature) coordinates.Gets the maximum display pressure.Gets the maximum display temperature.Gets the maximum X coordinate.Gets the maximum Y coordinate.Gets the minimum display pressure.Gets the minimum display temperature.Gets the minimum X coordinate.Gets the minimum Y coordinate.int
hashCode()
Returns the hash code of this instance.static EmagramCoordinateSystem
instance()
Factory method for obtaining an instance.static EmagramCoordinateSystem
instance
(RealTupleType referenceTupleType) Factory method for obtaining an instance.static EmagramCoordinateSystem
instance
(RealTupleType referenceTupleType, Real minimumPressure, Real maximumPressure, Real minimumTemperature, Real maximumTemperature, Unit pressureUnit, Unit temperatureUnit, Real minimumX, Real maximumX, Real minimumY, Real maximumY) Factory method for obtaining an instance.static void
Tests this class.double[][]
toReference
(double[][] coords) Transforms (pressure,temperature) coordinates to (X,Y) coordinates.Methods inherited from class visad.CoordinateSystem
canConvert, fromReference, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
-
Field Details
-
DEFAULT_MINIMUM_PRESSURE
The default minimum pressure. -
DEFAULT_MAXIMUM_PRESSURE
The default maximum pressure. -
DEFAULT_MINIMUM_TEMPERATURE
The default minimum temperature. -
DEFAULT_MAXIMUM_TEMPERATURE
The default maximum temperature.
-
-
Method Details
-
instance
Factory method for obtaining an instance. The RealTupleType of the reference coordinate system will be (RealType.XAxis,RealType.YAxis) and the default coordinate transformation will be used.- Returns:
- The default EmagramCoordinateSystem.
- Throws:
VisADException
- Couldn't create necessary VisAD object.
-
instance
public static EmagramCoordinateSystem instance(RealTupleType referenceTupleType) throws VisADException Factory method for obtaining an instance. The default coordinate transformation will be used.- Parameters:
referenceTupleType
- The type of the reference coordinate system. It shall have 2-3 components. The first component shall be the X component; the second component shall be the Y component; any third component is ignored.- Returns:
- The EmagramCoordinateSystem with
referenceTupleType
as its reference RealTupleType. - Throws:
VisADException
- Couldn't create necessary VisAD object.
-
instance
public static EmagramCoordinateSystem instance(RealTupleType referenceTupleType, Real minimumPressure, Real maximumPressure, Real minimumTemperature, Real maximumTemperature, Unit pressureUnit, Unit temperatureUnit, Real minimumX, Real maximumX, Real minimumY, Real maximumY) throws UnitException, VisADException Factory method for obtaining an instance. The resulting coordinate system will be centered in the given (X,Y) region and the given, extreme pressure and temperature values will not extend beyond it.- Parameters:
referenceTupleType
- The type of the reference coordinate system.minimumPressure
- The minimum, displayed pressure.maximumPressure
- The maximum, displayed pressure.minimumTemperature
- The minimum, displayed temperature.maximumTemperature
- The maximum, displayed temperature.pressureUnit
- The unit of pressure for numeric values.temperatureUnit
- The unit of temperature for numeric values.minimumX
- The minimum X coordinate.maximumX
- The maximum X coordinate.minimumY
- The minimum Y coordinate.maximumY
- The maximum Y coordinate.- Returns:
- The EmagramCoordinateSystem corresponding to the input parameters.
- Throws:
UnitException
- Improper unit.VisADException
- Couldn't create necessary VisAD object.
-
getMinimumPressure
Gets the minimum display pressure.- Specified by:
getMinimumPressure
in classAerologicalCoordinateSystem
- Returns:
- The minimum display pressure.
-
getMaximumPressure
Gets the maximum display pressure.- Specified by:
getMaximumPressure
in classAerologicalCoordinateSystem
- Returns:
- The maximum display pressure.
-
getMinimumTemperature
Gets the minimum display temperature.- Specified by:
getMinimumTemperature
in classAerologicalCoordinateSystem
- Returns:
- The minimum display temperature.
-
getMaximumTemperature
Gets the maximum display temperature.- Specified by:
getMaximumTemperature
in classAerologicalCoordinateSystem
- Returns:
- The maximum display temperature.
-
getMinimumX
Gets the minimum X coordinate.- Specified by:
getMinimumX
in classAerologicalCoordinateSystem
- Returns:
- The minimum X coordinate.
-
getMaximumX
Gets the maximum X coordinate.- Specified by:
getMaximumX
in classAerologicalCoordinateSystem
- Returns:
- The maximum X coordinate.
-
getMinimumY
Gets the minimum Y coordinate.- Specified by:
getMinimumY
in classAerologicalCoordinateSystem
- Returns:
- The minimum Y coordinate.
-
getMaximumY
Gets the maximum Y coordinate.- Specified by:
getMaximumY
in classAerologicalCoordinateSystem
- Returns:
- The maximum Y coordinate.
-
toReference
public double[][] toReference(double[][] coords) Transforms (pressure,temperature) coordinates to (X,Y) coordinates.- Specified by:
toReference
in classCoordinateSystem
- Parameters:
coords
- Real coordinates:coords[0][i]
andcoords[1][i]
are the pressure and temperature coordinates, respectively, of thei
th point. On output,coords[0][i]
andcoords[1][i]
are the corresponding X and Y display coordinates, respectively.- Returns:
- Corresponding display coordinates (i.e.
coords
).
-
fromReference
public double[][] fromReference(double[][] coords) Transforms (X,Y) coordinates to (pressure,temperature) coordinates.- Specified by:
fromReference
in classCoordinateSystem
- Parameters:
coords
- Display coordinates:coords[0][i]
andcoords[1][i]
are the X and Y display coordinates, respectively, of thei
th point. On output,coords[0][i]
andcoords[1][i]
are the corresponding pressure and temperature coordinates, respectively.- Returns:
- Corresponding real coordinates (i.e.
coords
).
-
equals
Indicate whether or not this coordinate system is the same as another.- Specified by:
equals
in classCoordinateSystem
- Parameters:
obj
- The object to be compared with this one.- Returns:
true
if and only ifobj
is semantically identical to this object.
-
hashCode
public int hashCode()Returns the hash code of this instance. -
main
Tests this class.- Parameters:
args
- Execution arguments. Ignored.- Throws:
Exception
- if something went wrong.
-
createDisplayCoordinateSystem
public AerologicalCoordinateSystem createDisplayCoordinateSystem(AerologicalCoordinateSystem acs) throws VisADException Create a 3D display coordinate system from the (possibly) 2D input.- Specified by:
createDisplayCoordinateSystem
in classAerologicalCoordinateSystem
- Parameters:
acs
- EmagramCoordinateSystem to get values from.- Returns:
- 3D version of (possibly) 2D system.
- Throws:
VisADException
- problem creating new CoordinateSystem
-