ucar.visad.quantities
Class GeopotentialAltitude

java.lang.Object
  extended by ucar.visad.quantities.Quantity
      extended by ucar.visad.quantities.ScalarQuantity
          extended by ucar.visad.quantities.GeopotentialAltitude

public final class GeopotentialAltitude
extends ScalarQuantity

Provides support for the quantity of geopotential altitude.

Version:
$Id: GeopotentialAltitude.java,v 1.15 2006/10/09 14:49:16 dmurray Exp $
Author:
Steven R. Emmerson

Nested Class Summary
static class GeopotentialAltitude.GeopotentialCoordinateSystem
          Provides support for coordinate system transformations between geopotential altitude and altitude.
 
Method Summary
static Data fromAltitude(Data altitude)
          Converts altitude to geopotential altitude.
static Data fromAltitude(Data altitude, Real gravity)
          Converts altitude to geopotential altitude based on a value for gravity.
static Unit getGeopotentialMeter()
          Gets the geopotential meter unit.
static Unit getGeopotentialUnit(Unit altUnit)
          Returns the standard geopotential altitude unit corresponding to an altitude unit.
static Unit getGeopotentialUnit(Unit altUnit, Real gravity)
          Returns the geopotential altitude unit corresponding to an altitude unit and gravity.
static RealTupleType getRealTupleType()
          Obtains the RealTupleType associated with this class.
static RealType getRealType()
          Obtains the RealType associated with this class.
static Data toAltitude(Data geopotentialAltitude)
          Converts from geopotential altitude to altitude.
static Data toAltitude(Data geopotentialAltitude, Real gravity)
          Converts from geopotential altitude to altitude.
static double[] toAltitude(double[] geoAlts, Unit geoUnit, Real gravity, double[] altitudes, Unit altUnit)
          Converts from geopotential altitude to altitude.
static double[] toAltitude(double[] geoAlts, Unit geoUnit, Real gravity, double[] altitudes, Unit altUnit, boolean copy)
          Converts from geopotential altitude to altitude.
static float[] toAltitude(float[] geoAlts, Unit geoUnit, Real gravity, float[] altitudes, Unit altUnit)
          Converts from geopotential altitude to altitude.
static float[] toAltitude(float[] geoAlts, Unit geoUnit, Real gravity, float[] altitudes, Unit altUnit, boolean copy)
          Converts from geopotential altitude to altitude.
static double[] toGeopotentialAltitude(double[] altitudes, Unit altUnit, Real gravity, double[] geoAlts, Unit geoUnit)
          Converts from altitude to geopotential altitude.
static double[] toGeopotentialAltitude(double[] altitudes, Unit altUnit, Real gravity, double[] geoAlts, Unit geoUnit, boolean copy)
          Converts from altitude to geopotential altitude.
static float[] toGeopotentialAltitude(float[] altitudes, Unit altUnit, Real gravity, float[] geoAlts, Unit geoUnit)
          Converts from altitude to geopotential altitude.
static float[] toGeopotentialAltitude(float[] altitudes, Unit altUnit, Real gravity, float[] geoAlts, Unit geoUnit, boolean copy)
          Converts from altitude to geopotential altitude.
 
Methods inherited from class ucar.visad.quantities.ScalarQuantity
getRealType, getRealType, realType
 
Methods inherited from class ucar.visad.quantities.Quantity
realTupleType, setRealTupleType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGeopotentialMeter

public static Unit getGeopotentialMeter()
                                 throws VisADException
Gets the geopotential meter unit.

Returns:
A geopotential meter unit.
Throws:
VisADException - Couldn't create necessary VisAD object.

getRealType

public static RealType getRealType()
                            throws VisADException
Obtains the RealType associated with this class.

Returns:
The RealType associated with this class.
Throws:
VisADException - Couldn't perform necessary VisAD operation.

getRealTupleType

public static RealTupleType getRealTupleType()
                                      throws VisADException
Obtains the RealTupleType associated with this class.

Returns:
The RealTupleType associated with this class.
Throws:
VisADException - Couldn't perform necessary VisAD operation.

fromAltitude

public static Data fromAltitude(Data altitude)
                         throws VisADException,
                                RemoteException
Converts altitude to geopotential altitude.

Parameters:
altitude - The altitude data object.
Returns:
The equivalent geopotential altitude data object.
Throws:
VisADException - if a core VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

fromAltitude

public static Data fromAltitude(Data altitude,
                                Real gravity)
                         throws VisADException,
                                RemoteException
Converts altitude to geopotential altitude based on a value for gravity.

Parameters:
altitude - The altitude data object.
gravity - The value for gravity.
Returns:
The equivalent geopotential altitude data object.
Throws:
VisADException - if a core VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

toAltitude

public static Data toAltitude(Data geopotentialAltitude,
                              Real gravity)
                       throws VisADException,
                              RemoteException
Converts from geopotential altitude to altitude.

Parameters:
geopotentialAltitude - Geopotential altitude.
gravity - Gravity.
Returns:
Altitude. The type of the object will be that of the arguments after standard promotion.
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
See Also:
VisADMath

toAltitude

public static Data toAltitude(Data geopotentialAltitude)
                       throws VisADException,
                              RemoteException
Converts from geopotential altitude to altitude.

Parameters:
geopotentialAltitude - Geopotential altitude.
Returns:
Altitude. The type of the object will be that of the arguments after standard promotion.
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
See Also:
VisADMath

toAltitude

public static double[] toAltitude(double[] geoAlts,
                                  Unit geoUnit,
                                  Real gravity,
                                  double[] altitudes,
                                  Unit altUnit)
                           throws VisADException,
                                  RemoteException
Converts from geopotential altitude to altitude.

Parameters:
geoAlts - Geopotential altitudes in units of geoUnit.
geoUnit - The unit of geopotential altitude.
gravity - Gravity.
altitudes - Altitudes in units of altUnit. Its length shall be at least geoAlts.length. It may be the same array as geoAlts.
altUnit - The unit of altitude.
Returns:
altitudes (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toAltitude

public static double[] toAltitude(double[] geoAlts,
                                  Unit geoUnit,
                                  Real gravity,
                                  double[] altitudes,
                                  Unit altUnit,
                                  boolean copy)
                           throws VisADException,
                                  RemoteException
Converts from geopotential altitude to altitude.

Parameters:
geoAlts - Geopotential altitudes in units of geoUnit.
geoUnit - The unit of geopotential altitude.
gravity - Gravity.
altitudes - Altitudes in units of altUnit. Its length shall be at least geoAlts.length. It may be the same array as geoAlts.
altUnit - The unit of altitude.
copy - if true, a new copy of the array will be made
Returns:
altitudes (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toAltitude

public static float[] toAltitude(float[] geoAlts,
                                 Unit geoUnit,
                                 Real gravity,
                                 float[] altitudes,
                                 Unit altUnit)
                          throws VisADException,
                                 RemoteException
Converts from geopotential altitude to altitude.

Parameters:
geoAlts - Geopotential altitudes in units of geoUnit.
geoUnit - The unit of geopotential altitude.
gravity - Gravity.
altitudes - Altitudes in units of altUnit. Its length shall be at least geoAlts.length. It may be the same array as geoAlts.
altUnit - The unit of altitude.
Returns:
altitudes (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toAltitude

public static float[] toAltitude(float[] geoAlts,
                                 Unit geoUnit,
                                 Real gravity,
                                 float[] altitudes,
                                 Unit altUnit,
                                 boolean copy)
                          throws VisADException,
                                 RemoteException
Converts from geopotential altitude to altitude.

Parameters:
geoAlts - Geopotential altitudes in units of geoUnit.
geoUnit - The unit of geopotential altitude.
gravity - Gravity.
altitudes - Altitudes in units of altUnit. Its length shall be at least geoAlts.length. It may be the same array as geoAlts.
altUnit - The unit of altitude.
copy - if true, a new copy of the array will be made
Returns:
altitudes (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toGeopotentialAltitude

public static double[] toGeopotentialAltitude(double[] altitudes,
                                              Unit altUnit,
                                              Real gravity,
                                              double[] geoAlts,
                                              Unit geoUnit)
                                       throws VisADException,
                                              RemoteException
Converts from altitude to geopotential altitude.

Parameters:
altitudes - Altitudes in units of altUnit.
altUnit - The unit of altitude.
gravity - Gravity.
geoAlts - Geopotential altitudes in units of geoUnit. Its length shall be at least altitudes.length. It may be the same array as altitudes.
geoUnit - The unit of geopotential altitude.
Returns:
geoAlts (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toGeopotentialAltitude

public static double[] toGeopotentialAltitude(double[] altitudes,
                                              Unit altUnit,
                                              Real gravity,
                                              double[] geoAlts,
                                              Unit geoUnit,
                                              boolean copy)
                                       throws VisADException,
                                              RemoteException
Converts from altitude to geopotential altitude.

Parameters:
altitudes - Altitudes in units of altUnit.
altUnit - The unit of altitude.
gravity - Gravity.
geoAlts - Geopotential altitudes in units of geoUnit. Its length shall be at least altitudes.length. It may be the same array as altitudes.
geoUnit - The unit of geopotential altitude.
copy - if true, a new copy of the array will be made
Returns:
geoAlts (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toGeopotentialAltitude

public static float[] toGeopotentialAltitude(float[] altitudes,
                                             Unit altUnit,
                                             Real gravity,
                                             float[] geoAlts,
                                             Unit geoUnit)
                                      throws VisADException,
                                             RemoteException
Converts from altitude to geopotential altitude.

Parameters:
altitudes - Altitudes in units of altUnit.
altUnit - The unit of altitude.
gravity - Gravity.
geoAlts - Geopotential altitudes in units of geoUnit. Its length shall be at least altitudes.length. It may be the same array as altitudes.
geoUnit - The unit of geopotential altitude.
Returns:
geoAlts (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

toGeopotentialAltitude

public static float[] toGeopotentialAltitude(float[] altitudes,
                                             Unit altUnit,
                                             Real gravity,
                                             float[] geoAlts,
                                             Unit geoUnit,
                                             boolean copy)
                                      throws VisADException,
                                             RemoteException
Converts from altitude to geopotential altitude.

Parameters:
altitudes - Altitudes in units of altUnit.
altUnit - The unit of altitude.
gravity - Gravity.
geoAlts - Geopotential altitudes in units of geoUnit. Its length shall be at least altitudes.length. It may be the same array as altitudes.
geoUnit - The unit of geopotential altitude.
copy - if true, a new copy of the array will be made
Returns:
geoAlts (as a convenience).
Throws:
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.

getGeopotentialUnit

public static Unit getGeopotentialUnit(Unit altUnit)
                                throws VisADException
Returns the standard geopotential altitude unit corresponding to an altitude unit.

Parameters:
altUnit - A unit of altitude (e.g. m)
Returns:
The standard geopotential altitude unit corresponding to altUnit (e.g. gpm).
Throws:
VisADException - VisAD failure.

getGeopotentialUnit

public static Unit getGeopotentialUnit(Unit altUnit,
                                       Real gravity)
                                throws UnitException,
                                       TypeException,
                                       RemoteException,
                                       VisADException
Returns the geopotential altitude unit corresponding to an altitude unit and gravity.

Parameters:
altUnit - A unit of altitude (e.g. meter).
gravity - The value of gravity.
Returns:
The geopotential altitude unit corresponding to altUnit (e.g. geopotential meter).
Throws:
UnitException - Altitude unit not a unit of length.
TypeException - gravity isn't gravity.
VisADException - VisAD failure.
RemoteException - Java RMI failure.