ucar.visad.quantities
Class GridRelativeHorizontalWind

java.lang.Object
  extended by ucar.visad.quantities.Quantity
      extended by ucar.visad.quantities.VectorQuantity
          extended by ucar.visad.quantities.Wind
              extended by ucar.visad.quantities.HorizontalWind
                  extended by ucar.visad.quantities.GridRelativeHorizontalWind

public final class GridRelativeHorizontalWind
extends HorizontalWind

The quantity of horizontal wind in vector coordinates that are relative to an underlying grid. Note that, in general, the X component of the wind won't be in an eastward direction.

Version:
$Revision: 1.14 $ $Date: 2006/12/05 19:04:33 $
Author:
Steven R. Emmerson

Field Summary
static boolean doNewCode
          flag for whether there is new code
 
Fields inherited from class ucar.visad.quantities.HorizontalWind
DEFAULT_SPEED_UNIT
 
Constructor Summary
GridRelativeHorizontalWind(SampledSet grid)
          Constructs from the underlying grid.
 
Method Summary
static Field cartesianHorizontalWind(Field rel)
          Converts grid-relative winds to true (or absolute) winds.
static FlatField cartesianHorizontalWind(FlatField rel)
          Converts grid-relative wind to true (or absolute) wind.
static Field timeSeriesCartesianHorizontalWind(Field rel)
          Converts a time-series of grid-relative winds to a time-series of true (or absolute) winds.
static RealType xWindType(SampledSet grid)
          Returns the RealType for the X component of a grid-relative wind.
static RealType yWindType(SampledSet grid)
          Returns the RealType for the Y component of a grid-relative wind.
 
Methods inherited from class ucar.visad.quantities.VectorQuantity
earthVectorType
 
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
 

Field Detail

doNewCode

public static boolean doNewCode
flag for whether there is new code

Constructor Detail

GridRelativeHorizontalWind

public GridRelativeHorizontalWind(SampledSet grid)
                           throws VisADException
Constructs from the underlying grid. The grid-relative X and Y components are assumed to be in the direction of increasing first and second dimensions, respectively. The MathType of the grid-relative X and Y components will be xWindType(grid) and yWindType(grid), respectively.

Parameters:
grid - The underlying grid.
Throws:
VisADException - if a VisAD failure occurs.
IllegalArgumentException - if grid.getDimension() < 2. or grid.getManifoldDimension() < 2.
NullPointerException - if the input grid is null.
See Also:
xWindType(SampledSet), yWindType(SampledSet)
Method Detail

xWindType

public static RealType xWindType(SampledSet grid)
                          throws VisADException
Returns the RealType for the X component of a grid-relative wind. The X component is in the direction of increasing first dimension of the grid. The name of the component will be X_Wind_Component, where X is the name of the first dimension of the grid, and the default unit will be HorizontalWind.DEFAULT_SPEED_UNIT.

Parameters:
grid - The grid.
Returns:
The RealType of the X wind component.
Throws:
VisADException - if a VisAD failure occurs.

yWindType

public static RealType yWindType(SampledSet grid)
                          throws VisADException
Returns the RealType for the Y component of a grid-relative wind. The Y component is in the direction of increasing second dimension of the grid. The name of the component will be Y_Wind_Component, where Y is the name of the second dimension of the grid, and the default unit will be HorizontalWind.DEFAULT_SPEED_UNIT.

Parameters:
grid - The grid.
Returns:
The RealType of the Y wind component.
Throws:
VisADException - if a VisAD failure occurs.

cartesianHorizontalWind

public static Field cartesianHorizontalWind(Field rel)
                                     throws VisADException,
                                            RemoteException
Converts grid-relative winds to true (or absolute) winds. The U and V components of true wind are WesterlyWind and SoutherlyWind, respectively. If the input Field is not a time-series, then it must be a FlatField and it must be compatible with the argument of cartesianHorizontalWind(FlatField). If, however, the the input Field is a time-series, then its domain must be a temporal Gridded1DSet or a SingletonSet and its range values must be compatible with the argument of cartesianHorizontalWind(FlatField).

Parameters:
rel - The grid-relative winds.
Returns:
The time-series of true wind corresponding to the input.
Throws:
NullPointerException - if rel is null.
IllegalArgumentException - if the input field is not a time-series and is incompatible with cartesianHorizontalWind(FlatField), or if the input field is a time-series but its range values are incompatible with cartesianHorizontalWind(FlatField).
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

timeSeriesCartesianHorizontalWind

public static Field timeSeriesCartesianHorizontalWind(Field rel)
                                               throws VisADException,
                                                      RemoteException
Converts a time-series of grid-relative winds to a time-series of true (or absolute) winds. The U and V components of true wind are WesterlyWind and SoutherlyWind, respectively. The domain of the input Field must be a temporal Gridded1DSet or a SingletonSet. The range values of the input Field must be FlatFields. The domains of the range FlatFields must have a manifold dimension of two or greater and they must have a reference system which contains RealType.Latitude and RealType.Longitude. The number of components in the range of the FlatFields must be two. Both components must have units convertible with HorizontalWind.DEFAULT_SPEED_UNIT. The first and second components are assumed to be the wind components in the direction of increasing first and second manifold dimension indexes, respectively. The domains of the FlatFields must be equal. The Field returned by this method has the same domain as the input Field. The range values of the returned Field are FlatFields that have the same domain as the input FlatFields. The MathType of the range of the returned FlatFields will be CartesianHorizontalWind.getEarthVectorType().

Parameters:
rel - The time-series of grid-relative wind.
Returns:
The time-series of true wind corresponding to the input.
Throws:
NullPointerException - if rel is null.
IllegalArgumentException - if the input field doesn't have a time-series domain, or if the range values aren't FlatField with the same domain, or if the domain of the FlatFields doesn't have a transformation to latitude and longitude, or if the domain is irregular or has too few points, or if the FlatFields don't have two and only two components in their range, or if the default units of the FlatFields range aren't equal.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
See Also:
CartesianHorizontalWind

cartesianHorizontalWind

public static FlatField cartesianHorizontalWind(FlatField rel)
                                         throws VisADException,
                                                RemoteException
Converts grid-relative wind to true (or absolute) wind. The U and V components of true wind are WesterlyWind and SoutherlyWind, respectively. The domain of the input FlatField must have a manifold dimension of two or greater and it must have a reference system which contains RealType.Latitude and RealType.Longitude. The number of components in the range of the input FlatField must be two. Both components must have units convertible with HorizontalWind.DEFAULT_SPEED_UNIT. The first and second components are assumed to be the wind components in the direction of increasing first and second manifold dimension indexes, respectively. The MathType of the range of the returned FlatField will be CartesianHorizontalWind.getEarthVectorType() and the domain will be the same as the input domain.

Parameters:
rel - The field of grid-relative wind.
Returns:
The field of true wind corresponding to the input field.
Throws:
NullPointerException - if rel is null.
IllegalArgumentException - if the input field doesn't have two and only two components in its range, or if the default units of the input range aren't equal, or if the domain of the input field doesn't have a transformation to latitude and longitude, or the grid is irregular or has too few points.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
See Also:
CartesianHorizontalWind