ucar.unidata.view.sounding
Class StuveCoordinateSystem

java.lang.Object
  extended by visad.CoordinateSystem
      extended by ucar.unidata.view.sounding.AerologicalCoordinateSystem
          extended by ucar.unidata.view.sounding.StuveCoordinateSystem
All Implemented Interfaces:
Serializable

public final class StuveCoordinateSystem
extends AerologicalCoordinateSystem

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.5 $ $Date: 2005/05/13 18:33:39 $
Author:
Steven R. Emmerson
See Also:
Serialized Form

Field Summary
static Real DEFAULT_MAXIMUM_PRESSURE
          The default maximum pressure.
static Real DEFAULT_MAXIMUM_TEMPERATURE
          The default maximum temperature.
static Real DEFAULT_MINIMUM_PRESSURE
          The default minimum pressure.
static Real DEFAULT_MINIMUM_TEMPERATURE
          The default minimum temperature.
 
Method Summary
 AerologicalCoordinateSystem createDisplayCoordinateSystem(AerologicalCoordinateSystem acs)
          Create a 3D display coordinate system from the (possibly) 2D input.
 boolean equals(Object obj)
          Indicate whether or not this coordinate system is the same as another.
 double[][] fromReference(double[][] coords)
          Transforms (X,Y) coordinates to (pressure,temperature) coordinates.
 Real getMaximumPressure()
          Gets the maximum display pressure.
 Real getMaximumTemperature()
          Gets the maximum display temperature.
 Real getMaximumX()
          Gets the maximum X coordinate.
 Real getMaximumY()
          Gets the maximum Y coordinate.
 Real getMinimumPressure()
          Gets the minimum display pressure.
 Real getMinimumTemperature()
          Gets the minimum display temperature.
 Real getMinimumX()
          Gets the minimum X coordinate.
 Real getMinimumY()
          Gets the minimum Y coordinate.
 int hashCode()
          Returns the hash code of this instance.
static StuveCoordinateSystem instance()
          Factory method for obtaining an instance.
static StuveCoordinateSystem instance(RealTupleType referenceTupleType)
          Factory method for obtaining an instance.
static StuveCoordinateSystem 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 main(String[] args)
          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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MINIMUM_PRESSURE

public static final Real DEFAULT_MINIMUM_PRESSURE
The default minimum pressure.


DEFAULT_MAXIMUM_PRESSURE

public static final Real DEFAULT_MAXIMUM_PRESSURE
The default maximum pressure.


DEFAULT_MINIMUM_TEMPERATURE

public static final Real DEFAULT_MINIMUM_TEMPERATURE
The default minimum temperature.


DEFAULT_MAXIMUM_TEMPERATURE

public static final Real DEFAULT_MAXIMUM_TEMPERATURE
The default maximum temperature.

Method Detail

instance

public static StuveCoordinateSystem instance()
                                      throws VisADException
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 StuveCoordinateSystem.
Throws:
VisADException - Couldn't create necessary VisAD object.

instance

public static StuveCoordinateSystem 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 StuveCoordinateSystem with referenceTupleType as its reference RealTupleType.
Throws:
VisADException - Couldn't create necessary VisAD object.

instance

public static StuveCoordinateSystem 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 StuveCoordinateSystem corresponding to the input parameters.
Throws:
UnitException - Improper unit.
VisADException - Couldn't create necessary VisAD object.

getMinimumPressure

public Real getMinimumPressure()
Gets the minimum display pressure.

Specified by:
getMinimumPressure in class AerologicalCoordinateSystem
Returns:
The minimum display pressure.

getMaximumPressure

public Real getMaximumPressure()
Gets the maximum display pressure.

Specified by:
getMaximumPressure in class AerologicalCoordinateSystem
Returns:
The maximum display pressure.

getMinimumTemperature

public Real getMinimumTemperature()
Gets the minimum display temperature.

Specified by:
getMinimumTemperature in class AerologicalCoordinateSystem
Returns:
The minimum display temperature.

getMaximumTemperature

public Real getMaximumTemperature()
Gets the maximum display temperature.

Specified by:
getMaximumTemperature in class AerologicalCoordinateSystem
Returns:
The maximum display temperature.

getMinimumX

public Real getMinimumX()
Gets the minimum X coordinate.

Specified by:
getMinimumX in class AerologicalCoordinateSystem
Returns:
The minimum X coordinate.

getMaximumX

public Real getMaximumX()
Gets the maximum X coordinate.

Specified by:
getMaximumX in class AerologicalCoordinateSystem
Returns:
The maximum X coordinate.

getMinimumY

public Real getMinimumY()
Gets the minimum Y coordinate.

Specified by:
getMinimumY in class AerologicalCoordinateSystem
Returns:
The minimum Y coordinate.

getMaximumY

public Real getMaximumY()
Gets the maximum Y coordinate.

Specified by:
getMaximumY in class AerologicalCoordinateSystem
Returns:
The maximum Y coordinate.

toReference

public double[][] toReference(double[][] coords)
Transforms (pressure,temperature) coordinates to (X,Y) coordinates.

Specified by:
toReference in class CoordinateSystem
Parameters:
coords - Real coordinates: coords[0][i] and coords[1][i] are the pressure and temperature coordinates, respectively, of the ith point. On output, coords[0][i] and coords[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 class CoordinateSystem
Parameters:
coords - Display coordinates: coords[0][i] and coords[1][i] are the X and Y display coordinates, respectively, of the ith point. On output, coords[0][i] and coords[1][i] are the corresponding pressure and temperature coordinates, respectively.
Returns:
Corresponding real coordinates (i.e. coords).

equals

public boolean equals(Object obj)
Indicate whether or not this coordinate system is the same as another.

Specified by:
equals in class CoordinateSystem
Parameters:
obj - The object to be compared with this one.
Returns:
true if and only if obj is semantically identical to this object.

hashCode

public int hashCode()
Returns the hash code of this instance.

Overrides:
hashCode in class Object
Returns:
The hash code of this instance.

main

public static void main(String[] args)
                 throws Exception
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 class AerologicalCoordinateSystem
Parameters:
acs - StuveCoordinateSystem to get values from.
Returns:
3D version of (possibly) 2D system.
Throws:
VisADException - problem creating new CoordinateSystem