ucar.nc2.ft.grid
Interface GridCoordSys


public interface GridCoordSys

A Coordinate System for gridded data. Assume:

Since:
Jan 19, 2010
Author:
caron

Method Summary
 int[] findXYindexFromCoord(double x_coord, double y_coord, int[] result)
          Given a point in x,y coordinate space, find the x,y indices.
 int[] findXYindexFromCoordBounded(double x_coord, double y_coord, int[] result)
          Given a point in x,y coordinate space, find the x,y indices.
 int[] findXYindexFromLatLon(double lat, double lon, int[] result)
          Given a lat,lon point, find the x,y index of the containing grid point.
 int[] findXYindexFromLatLonBounded(double lat, double lon, int[] result)
          Given a lat,lon point, find the x,y index of the containing grid point.
 ProjectionRect getBoundingBox()
          Get horizontal bounding box in projection coordinates.
 List<CoordinateAxis> getCoordinateAxes()
          Get the list of all axes.
 List<CoordinateTransform> getCoordinateTransforms()
          Get the list of all CoordinateTransforms.
 DateRange getDateRange()
          If there is a time coordinate, get the time covered.
 List<Dimension> getDomain()
          Get the list of dimensions used by any of the Axes in the Coordinate System.
 CoordinateAxis1D getEnsembleAxis()
          Get the ensemble axis.
 LatLonPoint getLatLon(int xindex, int yindex)
          Get the Lat/Lon coordinates of the midpoint of a grid cell, using the x,y indices.
 LatLonRect getLatLonBoundingBox()
          Get horizontal bounding box in lat, lon coordinates.
 String getName()
          The name of the Grid Coordinate System.
 ProjectionImpl getProjection()
          Get the Projection that performs the transform math.
 ProjectionCT getProjectionCT()
          Get the Projection CoordinateTransform.
 List<Range> getRangesFromLatLonRect(LatLonRect llbb)
          Get Index Ranges for the given lat, lon bounding box.
 CoordinateAxis1DTime getRunTimeAxis()
          Get the RunTime axis.
 CoordinateAxis getTimeAxis()
          Get the Time axis, if it exists.
 CoordinateAxis1DTime getTimeAxis1D()
          Get the Time axis, if it exists, and its 1-dimensional.
 CoordinateAxis1DTime getTimeAxisForRun(Date runTime)
          This is the case of a 2D time axis, which depends on the run index.
 CoordinateAxis1D getVerticalAxis()
          Get the Z axis.
 VerticalCT getVerticalCT()
          Get the Vertical CoordinateTransform, it it exists.
 VerticalTransform getVerticalTransform()
          Get the VerticalTransform that performs the transform math.
 CoordinateAxis getXHorizAxis()
          Get the X axis.
 CoordinateAxis getYHorizAxis()
          Get the Y axis.
 boolean hasTimeAxis()
          True if there is a Time Axis.
 boolean hasTimeAxis1D()
          True if there is a Time Axis and it is 1D.
 boolean isLatLon()
          Does this use lat/lon horizontal axes? If not, then the horizontal axes are GeoX, GeoY, and there must be a Projection defined.
 boolean isProductSet()
          True if all axes are 1 dimensional.
 boolean isRegularSpatial()
          True if both X and Y axes are 1 dimensional and are regularly spaced.
 boolean isZPositive()
          True if increasing z coordinate values means "up" in altitude
 

Method Detail

getName

String getName()
The name of the Grid Coordinate System.

Returns:
name of the Grid Coordinate System

getDomain

List<Dimension> getDomain()
Get the list of dimensions used by any of the Axes in the Coordinate System.

Returns:
List of Dimension

getCoordinateAxes

List<CoordinateAxis> getCoordinateAxes()
Get the list of all axes.

Returns:
List of CoordinateAxis.

isProductSet

boolean isProductSet()
True if all axes are 1 dimensional.

Returns:
true if all axes are 1 dimensional.

getCoordinateTransforms

List<CoordinateTransform> getCoordinateTransforms()
Get the list of all CoordinateTransforms.

Returns:
List of CoordinateTransform.

isRegularSpatial

boolean isRegularSpatial()
True if both X and Y axes are 1 dimensional and are regularly spaced.

Returns:
true if both X and Y axes are 1 dimensional and are regularly spaced.

getXHorizAxis

CoordinateAxis getXHorizAxis()
Get the X axis. May be 1 or 2 dimensional.

Returns:
X CoordinateAxis, may not be null.

getYHorizAxis

CoordinateAxis getYHorizAxis()
Get the Y axis. May be 1 or 2 dimensional.

Returns:
Y CoordinateAxis, may not be null.

isLatLon

boolean isLatLon()
Does this use lat/lon horizontal axes? If not, then the horizontal axes are GeoX, GeoY, and there must be a Projection defined.

Returns:
true if lat/lon horizontal axes

getLatLonBoundingBox

LatLonRect getLatLonBoundingBox()
Get horizontal bounding box in lat, lon coordinates. For projection, only an approximation based on corners.

Returns:
LatLonRect bounding box.

getBoundingBox

ProjectionRect getBoundingBox()
Get horizontal bounding box in projection coordinates. For lat/lon, the ProjectionRect has units of degrees north and east.

Returns:
ProjectionRect bounding box.

getProjectionCT

ProjectionCT getProjectionCT()
Get the Projection CoordinateTransform. It must exist if !isLatLon().

Returns:
ProjectionCT or null.

getProjection

ProjectionImpl getProjection()
Get the Projection that performs the transform math. Same as getProjectionCT().getProjection().

Returns:
ProjectionImpl or null.

getRangesFromLatLonRect

List<Range> getRangesFromLatLonRect(LatLonRect llbb)
                                    throws InvalidRangeException
Get Index Ranges for the given lat, lon bounding box. For projection, only an approximation based on corners. Must have CoordinateAxis1D or 2D for x and y axis.

Parameters:
llbb - a lat/lon bounding box.
Returns:
list of 2 Range objects, first y then x.
Throws:
InvalidRangeException - if llbb generates bad ranges

findXYindexFromCoord

int[] findXYindexFromCoord(double x_coord,
                           double y_coord,
                           int[] result)
Given a point in x,y coordinate space, find the x,y indices.

Parameters:
x_coord - position in x coordinate space, ie, units of getXHorizAxis().
y_coord - position in y coordinate space, ie, units of getYHorizAxis().
result - optionally pass in the result array to use.
Returns:
int[2], 0=x, 1=y indices of the point. These will be -1 if out of range.

findXYindexFromCoordBounded

int[] findXYindexFromCoordBounded(double x_coord,
                                  double y_coord,
                                  int[] result)
Given a point in x,y coordinate space, find the x,y indices. If outside the range, the closest point is returned

Parameters:
x_coord - position in x coordinate space, ie, units of getXHorizAxis().
y_coord - position in y coordinate space, ie, units of getYHorizAxis().
result - optionally pass in the result array to use.
Returns:
int[2], 0=x, 1=y indices of the point.

findXYindexFromLatLon

int[] findXYindexFromLatLon(double lat,
                            double lon,
                            int[] result)
Given a lat,lon point, find the x,y index of the containing grid point.

Parameters:
lat - latitude position.
lon - longitude position.
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.

findXYindexFromLatLonBounded

int[] findXYindexFromLatLonBounded(double lat,
                                   double lon,
                                   int[] result)
Given a lat,lon point, find the x,y index of the containing grid point. If outside the range, the closest point is returned

Parameters:
lat - latitude position.
lon - longitude position.
result - return result here, may be null
Returns:
int[2], 0=x,1=y indices in the coordinate system of the point.

getLatLon

LatLonPoint getLatLon(int xindex,
                      int yindex)
Get the Lat/Lon coordinates of the midpoint of a grid cell, using the x,y indices.

Parameters:
xindex - x index
yindex - y index
Returns:
lat/lon coordinate of the midpoint of the cell

getVerticalAxis

CoordinateAxis1D getVerticalAxis()
Get the Z axis. Must be 1 dimensional.

Returns:
Y CoordinateAxis, may be null.

isZPositive

boolean isZPositive()
True if increasing z coordinate values means "up" in altitude

Returns:
true if increasing z coordinate values means "up" in altitude

getVerticalCT

VerticalCT getVerticalCT()
Get the Vertical CoordinateTransform, it it exists.

Returns:
VerticalCT or null.

getVerticalTransform

VerticalTransform getVerticalTransform()
Get the VerticalTransform that performs the transform math. Same as getVerticalCT().getVerticalTransform().

Returns:
VerticalTransform or null.

getEnsembleAxis

CoordinateAxis1D getEnsembleAxis()
Get the ensemble axis. Must be 1 dimensional. Typical meaning is an enumeration of ensemble Model runs.

Returns:
ensemble CoordinateAxis, may be null.

hasTimeAxis

boolean hasTimeAxis()
True if there is a Time Axis.

Returns:
true if there is a Time Axis.

getDateRange

DateRange getDateRange()
If there is a time coordinate, get the time covered.

Returns:
DateRange or null if no time coordinate

getTimeAxis

CoordinateAxis getTimeAxis()
Get the Time axis, if it exists. May be 1 or 2 dimensional. If 1D, will be a CoordinateAxis1DTime. If 2D, then you can use getTimeAxisForRun(). A time coordinate must be a udunit date or ISO String, so it can always be converted to a Date. Typical meaning is the date of measurement or valid forecast time.

Returns:
the time coordinate axis, may be null.

getRunTimeAxis

CoordinateAxis1DTime getRunTimeAxis()
Get the RunTime axis. Must be 1 dimensional. A runtime coordinate must be a udunit date or ISO String, so it can always be converted to a Date. Typical meaning is the date that a Forecast Model Run is made.

Returns:
RunTime CoordinateAxis, may be null.

hasTimeAxis1D

boolean hasTimeAxis1D()
True if there is a Time Axis and it is 1D.

Returns:
true if there is a Time Axis and it is 1D.

getTimeAxis1D

CoordinateAxis1DTime getTimeAxis1D()
Get the Time axis, if it exists, and its 1-dimensional.

Returns:
the time coordinate axis, may be null.

getTimeAxisForRun

CoordinateAxis1DTime getTimeAxisForRun(Date runTime)
This is the case of a 2D time axis, which depends on the run index. A time coordinate must be a udunit date or ISO String, so it can always be converted to a Date.

Parameters:
runTime - which run?
Returns:
1D time axis for that run.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.