ucar.nc2.dataset.grid
Class GridCoordSys

java.lang.Object
  extended by ucar.nc2.dataset.CoordinateSystem
      extended by ucar.nc2.dataset.grid.GridCoordSys

Deprecated. (use ucar.nc2.dt.grid)

public class GridCoordSys
extends CoordinateSystem

A georeferencing "gridded" CoordinateSystem. This describes a "grid" of coordinates, which implies a connected topology such that values next to each other in index space are next to each other in coordinate space. Note: these classes should be considered experimental and will likely be refactored in the next release.

This currently assumes that the CoordinateSystem

  1. is georeferencing (has Lat, Lon or GeoX, GeoY axes)
  2. x, y are 1 or 2-dimensional axes.
  3. z, t are 1-dimensional axes.

This is the common case for georeferencing coordinate systems. Mathematically it is a product set: {X,Y} x {Z} x {T}. The x and y axes may be 1 or 2 dimensional.

A CoordinateSystem may have multiple horizontal and vertical axes. GridCoordSys chooses one axis corresponding to X, Y, Z, and T. It gives preference to one dimensional axes (CoordinateAxis1D).

Version:
$Revision: 1.39 $ $Date: 2006/07/14 20:10:19 $
Author:
caron

Field Summary
 
Fields inherited from class ucar.nc2.dataset.CoordinateSystem
aziAxis, coordAxes, coordTrans, dataType, domain, ds, elevAxis, hAxis, isImplicit, latAxis, lonAxis, name, pAxis, radialAxis, tAxis, xAxis, yAxis, zAxis
 
Constructor Summary
GridCoordSys(CoordinateSystem cs)
          Deprecated. Create a GridCoordSys from an existing Coordinate System.
GridCoordSys(GridCoordSys from, Range t_range, Range z_range, Range y_range, Range x_range)
          Deprecated. Create a GridCoordSys as a section of an existing GridCoordSys.
 
Method Summary
 int findTimeCoordElement(java.util.Date d)
          Deprecated. Given a Date, find the corresponding time index on the time coordinate axis.
 int[] findXYCoordElement(double xpos, double ypos, int[] result)
          Deprecated. Given a point in x,y coordinate space, find the x,y index in the coordinate system.
 ProjectionRect getBoundingBox()
          Deprecated. Get the x,y bounding box in projection coordinates.
 DateRange getDateRange()
          Deprecated.  
 DateUnit getDateUnit()
          Deprecated.  
 LatLonRect getLatLonBoundingBox()
          Deprecated. Get horizontal bounding box in lat, lon coordinates.
 java.util.List getLatLonBoundingBox(LatLonRect rect)
          Deprecated. Get Index Ranges for the given lat, lon bounding box.
 int getLevelIndex(java.lang.String name)
          Deprecated. Get the index corresponding to the level name.
 java.lang.String getLevelName(int index)
          Deprecated. Get the String name for the ith level(z) coordinate.
 java.util.ArrayList getLevels()
          Deprecated. Get the list of level names, to be used for user selection.
 ProjectionImpl getProjection()
          Deprecated. get the projection
 CoordinateAxis1D getTimeAxis()
          Deprecated. get the Time axis (same as getTaxis())
 java.util.Date[] getTimeDates()
          Deprecated. Get the list of times as Dates.
 int getTimeIndex(java.lang.String name)
          Deprecated. Get the index corresponding to the level name.
 java.lang.String getTimeName(int index)
          Deprecated. Get the string name for the ith time coordinate.
 TimeUnit getTimeResolution()
          Deprecated. only if isRegular()
 java.util.ArrayList getTimes()
          Deprecated. Get the list of time names, to be used for user selection.
 CoordinateAxis1D getVerticalAxis()
          Deprecated. get the Vertical axis (either Geoz, Height, or Pressure)
 VerticalTransform getVerticalTransform()
          Deprecated. Get the vertical transform, if any.
 VerticalCT getVerticalTransform2()
          Deprecated.  
 CoordinateAxis getXHorizAxis()
          Deprecated. get the X Horizontal axis (either GeoX or Lon)
 CoordinateAxis getYHorizAxis()
          Deprecated. get the Y Horizontal axis (either GeoY or Lat)
 boolean isDate()
          Deprecated. is there a time coordinate, and can it be expressed as a Date?
static boolean isGridCoordSys(java.lang.StringBuffer sbuff, CoordinateSystem cs)
          Deprecated. Determine if this CoordinateSystem can be made into a GridCoordSys.
 boolean isLatLon()
          Deprecated. is this a Lat/Lon coordinate system?
 boolean isRegularSpatial()
          Deprecated. true if all spatial axes are CoordinateAxis1D and are regular
 boolean isZPositive()
          Deprecated. true if increasing z coordinate values means "up" in altitude
static GridCoordSys makeGridCoordSys(java.lang.StringBuffer sbuff, CoordinateSystem cs, VariableEnhanced v)
          Deprecated. Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v.
 java.lang.String toString()
          Deprecated. String representation.
 
Methods inherited from class ucar.nc2.dataset.CoordinateSystem
addCoordinateTransform, addCoordinateTransforms, containsAxes, containsAxis, containsAxisType, containsAxisTypes, containsDomain, equals, findAxis, getAzimuthAxis, getCoordinateAxes, getCoordinateTransforms, getDomain, getElevationAxis, getHeightAxis, getLatAxis, getLonAxis, getName, getPressureAxis, getProjectionCT, getRadialAxis, getRankDomain, getRankRange, getTaxis, getXaxis, getYaxis, getZaxis, hashCode, hasTimeAxis, hasVerticalAxis, isComplete, isGeoReferencing, isGeoXY, isImplicit, isProductSet, isRadial, isRegular, makeName, setImplicit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridCoordSys

public GridCoordSys(CoordinateSystem cs)
Deprecated. 
Create a GridCoordSys from an existing Coordinate System. This will choose which axes are the XHoriz, YHoriz, Vertical, and Time. If theres a Projection, it will set its map area


GridCoordSys

public GridCoordSys(GridCoordSys from,
                    Range t_range,
                    Range z_range,
                    Range y_range,
                    Range x_range)
             throws InvalidRangeException
Deprecated. 
Create a GridCoordSys as a section of an existing GridCoordSys. This will create sections of the corresponding CoordinateAxes.

Parameters:
from - copy this GridCoordSys
t_range - subset the time dimension, or null if you want all of it
z_range - subset the vertical dimension, or null if you want all of it
y_range - subset the y dimension, or null if you want all of it
x_range - subset the x dimension, or null if you want all of it
Throws:
InvalidRangeException
Method Detail

isGridCoordSys

public static boolean isGridCoordSys(java.lang.StringBuffer sbuff,
                                     CoordinateSystem cs)
Deprecated. 
Determine if this CoordinateSystem can be made into a GridCoordSys. This currently assumes that the CoordinateSystem:
  1. is georeferencing (cs.isGeoReferencing())
  2. x, y are 1 or 2-dimensional axes.
  3. z, t, if they exist, are 1-dimensional axes.
  4. domain rank > 1

Parameters:
cs - the CoordinateSystem to test
Returns:
true if it can be made into a GridCoordSys.
See Also:
CoordinateSystem.isGeoReferencing()

makeGridCoordSys

public static GridCoordSys makeGridCoordSys(java.lang.StringBuffer sbuff,
                                            CoordinateSystem cs,
                                            VariableEnhanced v)
Deprecated. 
Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v.

Parameters:
sbuff - put debug information into this StringBuffer; may be null.
cs - CoordinateSystem to check.
v - Variable to check.
Returns:
the GridCoordSys made from cs, else null.

getVerticalTransform

public VerticalTransform getVerticalTransform()
Deprecated. 
Get the vertical transform, if any.


getVerticalTransform2

public VerticalCT getVerticalTransform2()
Deprecated. 

getXHorizAxis

public CoordinateAxis getXHorizAxis()
Deprecated. 
get the X Horizontal axis (either GeoX or Lon)


getYHorizAxis

public CoordinateAxis getYHorizAxis()
Deprecated. 
get the Y Horizontal axis (either GeoY or Lat)


getVerticalAxis

public CoordinateAxis1D getVerticalAxis()
Deprecated. 
get the Vertical axis (either Geoz, Height, or Pressure)


getTimeAxis

public CoordinateAxis1D getTimeAxis()
Deprecated. 
get the Time axis (same as getTaxis())


getProjection

public ProjectionImpl getProjection()
Deprecated. 
get the projection

Overrides:
getProjection in class CoordinateSystem
Returns:
ProjectionImpl or null if none.

getLevels

public java.util.ArrayList getLevels()
Deprecated. 
Get the list of level names, to be used for user selection. The ith one refers to the ith level coordinate.

Returns:
ArrayList of ucar.nc2.util.NamedObject, or empty list.

getTimes

public java.util.ArrayList getTimes()
Deprecated. 
Get the list of time names, to be used for user selection. The ith one refers to the ith time coordinate.

Returns:
ArrayList of ucar.nc2.util.NamedObject, or empty list.

getTimeDates

public java.util.Date[] getTimeDates()
Deprecated. 
Get the list of times as Dates. Only valid if isDate() is true;

Returns:
array of java.util.Date, or null.

isLatLon

public boolean isLatLon()
Deprecated. 
is this a Lat/Lon coordinate system?

Overrides:
isLatLon in class CoordinateSystem

isDate

public boolean isDate()
Deprecated. 
is there a time coordinate, and can it be expressed as a Date?


isZPositive

public boolean isZPositive()
Deprecated. 
true if increasing z coordinate values means "up" in altitude


isRegularSpatial

public boolean isRegularSpatial()
Deprecated. 
true if all spatial axes are CoordinateAxis1D and are regular


findXYCoordElement

public int[] findXYCoordElement(double xpos,
                                double ypos,
                                int[] result)
Deprecated. 
Given a point in x,y coordinate space, find the x,y index in the coordinate system. Not implemented yet for 2D.

Parameters:
xpos - position in x coordinate space.
ypos - position in y coordinate space.
result - put result in here, may be null
Returns:
int[2], 0=x,1=y indices in the coordinate system of the point. These will be -1 if out of range.

findTimeCoordElement

public int findTimeCoordElement(java.util.Date d)
Deprecated. 
Given a Date, find the corresponding time index on the time coordinate axis. Can only call this is hasDate() is true. This will return

Parameters:
d - date to look for
Returns:
corresponding time index on the time coordinate axis
Throws:
java.lang.UnsupportedOperationException - is no time axis or isDate() false

getLevelName

public java.lang.String getLevelName(int index)
Deprecated. 
Get the String name for the ith level(z) coordinate.

Parameters:
index - which level coordinate
Returns:
level name

getLevelIndex

public int getLevelIndex(java.lang.String name)
Deprecated. 
Get the index corresponding to the level name.

Parameters:
name - level name
Returns:
level index, or -1 if not found

getTimeName

public java.lang.String getTimeName(int index)
Deprecated. 
Get the string name for the ith time coordinate.

Parameters:
index - which time coordinate
Returns:
time name.

getTimeIndex

public int getTimeIndex(java.lang.String name)
Deprecated. 
Get the index corresponding to the level name.

Parameters:
name - level name
Returns:
level index, or -1 if not found

getDateRange

public DateRange getDateRange()
Deprecated. 

getDateUnit

public DateUnit getDateUnit()
                     throws java.lang.Exception
Deprecated. 
Throws:
java.lang.Exception

getTimeResolution

public TimeUnit getTimeResolution()
                           throws java.lang.Exception
Deprecated. 
only if isRegular()

Throws:
java.lang.Exception

getBoundingBox

public ProjectionRect getBoundingBox()
Deprecated. 
Get the x,y bounding box in projection coordinates.


getLatLonBoundingBox

public LatLonRect getLatLonBoundingBox()
Deprecated. 
Get horizontal bounding box in lat, lon coordinates.

Returns:
lat, lon bounding box.

getLatLonBoundingBox

public java.util.List getLatLonBoundingBox(LatLonRect rect)
Deprecated. 
Get Index Ranges for the given lat, lon bounding box. For projection, only an approximation based on latlon corners. Must have CoordinateAxis1D or 2D for x and y axis.

Returns:
list of 2 Range objects, first y then x.

toString

public java.lang.String toString()
Deprecated. 
String representation.

Overrides:
toString in class CoordinateSystem