Package ucar.nc2.dt
Interface GridCoordSystem
-
- All Known Implementing Classes:
GridCoordSys
public interface GridCoordSystem
A Coordinate System for gridded data. Assume:- X and Y are 1 or 2 dimensional
- T is 1 or 2 dimensional. The 2D case is that it depends on runtime.
- We can create Dates out of the T and RT coordinate values.
- Z, E, RT are 1-dimensional
- An optional VerticalTransform can provide a height or pressure coordinate that may be 1-4 dimensional.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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.CalendarDateRange
getCalendarDateRange()
List<CalendarDate>
getCalendarDates()
List<CoordinateAxis>
getCoordinateAxes()
Get the list of all axes.List<CoordinateTransform>
getCoordinateTransforms()
Get the list of all CoordinateTransforms.DateRange
getDateRange()
Deprecated.use getCalendarDateRange()Collection<Dimension>
getDomain()
Get the list of dimensions used by any of the Axes in the Coordinate System.CoordinateAxis1D
getEnsembleAxis()
Get the ensemble axis.String
getHorizStaggerType()
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, consisting of the list of coordinate axes, separated by blanks.ProjectionImpl
getProjection()
Deprecated.this will return Projection, not ProjectionImpl in 6.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 if its 1-dimensional.CoordinateAxis1DTime
getTimeAxisForRun(int run_index)
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
isGlobalLon()
Is this a global coverage over longitude ?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 altitudevoid
setProjectionBoundingBox()
Use the bounding box to set the defaule map are of the projection.void
show(Formatter buff, boolean showCoords)
-
-
-
Method Detail
-
getName
String getName()
The name of the Grid Coordinate System, consisting of the list of coordinate axes, separated by blanks.- Returns:
- name of the Grid Coordinate System
-
getDomain
Collection<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.
-
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.
-
getVerticalAxis
CoordinateAxis1D getVerticalAxis()
Get the Z axis. Must be 1 dimensional.- Returns:
- Y CoordinateAxis, may be null.
-
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.
-
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.
-
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.
-
getCoordinateTransforms
List<CoordinateTransform> getCoordinateTransforms()
Get the list of all CoordinateTransforms.- Returns:
- List of CoordinateTransform.
-
getProjectionCT
ProjectionCT getProjectionCT()
Get the Projection CoordinateTransform. It must exist if !isLatLon().- Returns:
- ProjectionCT or null.
-
getProjection
ProjectionImpl getProjection()
Deprecated.this will return Projection, not ProjectionImpl in 6.Get the Projection that performs the transform math. Same as getProjectionCT().getProjection().- Returns:
- ProjectionImpl or null.
-
setProjectionBoundingBox
void setProjectionBoundingBox()
Use the bounding box to set the defaule map are of the projection. This can be expensive if its a 2D coordinate system.
-
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.
-
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
-
isGlobalLon
boolean isGlobalLon()
Is this a global coverage over longitude ?- Returns:
- true if isLatLon and longitude extent >= 360 degrees
-
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.
-
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.
-
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 indexyindex
- y index- Returns:
- lat/lon coordinate of the midpoint of the cell
-
isZPositive
boolean isZPositive()
True if increasing z coordinate values means "up" in altitude- Returns:
- true if increasing z coordinate values means "up" in altitude
-
getDateRange
DateRange getDateRange()
Deprecated.use getCalendarDateRange()If there is a time coordinate, get the time covered.- Returns:
- DateRange or null if no time coordinate
-
hasTimeAxis
boolean hasTimeAxis()
True if there is a Time Axis.- Returns:
- true if there is a Time Axis.
-
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 if its 1-dimensional.- Returns:
- the time coordinate axis, may be null.
-
getTimeAxisForRun
CoordinateAxis1DTime getTimeAxisForRun(int run_index)
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:
run_index
- which run?- Returns:
- 1D time axis for that run. Null if not 2D time
-
getCalendarDates
List<CalendarDate> getCalendarDates()
-
getCalendarDateRange
CalendarDateRange getCalendarDateRange()
-
getHorizStaggerType
String getHorizStaggerType()
-
show
void show(Formatter buff, boolean showCoords)
-
-