|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.dataset.CoordinateSystem
ucar.nc2.dt.grid.GridCoordSys
public class GridCoordSys
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.
This currently assumes that the CoordinateSystem
Field Summary |
---|
Fields inherited from class ucar.nc2.dataset.CoordinateSystem |
---|
aziAxis, coordAxes, coordTrans, dataType, domain, ds, elevAxis, ensAxis, hAxis, isImplicit, latAxis, lonAxis, name, pAxis, radialAxis, tAxis, xAxis, yAxis, zAxis |
Constructor Summary | |
---|---|
GridCoordSys(CoordinateSystem cs,
Formatter sbuff)
Create a GridCoordSys from an existing Coordinate System. |
|
GridCoordSys(GridCoordSys from,
Range t_range,
Range z_range,
Range y_range,
Range x_range)
Create a GridCoordSys as a section of an existing GridCoordSys. |
|
GridCoordSys(GridCoordSys from,
Range rt_range,
Range e_range,
Range t_range,
Range z_range,
Range y_range,
Range x_range)
Create a GridCoordSys as a section of an existing GridCoordSys. |
Method Summary | |
---|---|
int |
findTimeIndexFromDate(Date d)
Deprecated. use CoordinateAxis1DTime.findTimeIndexFromDate |
int[] |
findXYCoordElement(double x_coord,
double y_coord,
int[] result)
Deprecated. use findXYindexFromCoord |
int[] |
findXYindexFromCoord(double x_coord,
double y_coord,
int[] result)
Given a point in x,y coordinate space, find the x,y index in the coordinate system. |
int[] |
findXYindexFromCoordBounded(double x_coord,
double y_coord,
int[] result)
Given a point in x,y coordinate space, find the x,y index in the coordinate system. |
int[] |
findXYindexFromLatLon(double lat,
double lon,
int[] result)
Given a lat,lon point, find the x,y index in the coordinate system. |
int[] |
findXYindexFromLatLonBounded(double lat,
double lon,
int[] result)
Given a lat,lon point, find the x,y index in the coordinate system. |
ProjectionRect |
getBoundingBox()
Get the x,y bounding box in projection coordinates. |
DateRange |
getDateRange()
If there is a time coordinate, get the time covered. |
DateUnit |
getDateUnit()
|
CoordinateAxis1D |
getEnsembleAxis()
get the Ensemble axis, else null |
LatLonPoint |
getLatLon(double xcoord,
double ycoord)
|
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. |
List<Range> |
getLatLonBoundingBox(LatLonRect rect)
Deprecated. use getRangesFromLatLonRect. |
int |
getLevelIndex(String name)
Get the index corresponding to the level name. |
String |
getLevelName(int index)
Get the String name for the ith level(z) coordinate. |
List<NamedObject> |
getLevels()
Get the list of level names, to be used for user selection. |
ProjectionImpl |
getProjection()
get the projection |
List<Range> |
getRangesFromLatLonRect(LatLonRect rect)
Get Index Ranges for the given lat, lon bounding box. |
CoordinateAxis1DTime |
getRunTimeAxis()
get the RunTime axis, else null |
CoordinateAxis |
getTimeAxis()
get the Time axis |
CoordinateAxis1DTime |
getTimeAxis1D()
get the Time axis, if its 1-dimensional |
CoordinateAxis1DTime |
getTimeAxisForRun(int run_index)
This is the case of a 2D time axis, which depends on the run index. |
Date[] |
getTimeDates()
Get the list of times as Dates. |
int |
getTimeIndex(String name)
Deprecated. |
String |
getTimeName(int index)
Deprecated. |
TimeUnit |
getTimeResolution()
Get the resolution of the time coordinate. |
List<NamedObject> |
getTimes()
Get the list of time names, to be used for user selection. |
CoordinateAxis1D |
getVerticalAxis()
get the Vertical axis (either Geoz, Height, or Pressure) |
VerticalCT |
getVerticalCT()
Get the Coordinate Transform description. |
VerticalTransform |
getVerticalTransform()
Get the vertical transform function, or null if none |
CoordinateAxis |
getXHorizAxis()
get the X Horizontal axis (either GeoX or Lon) |
CoordinateAxis |
getYHorizAxis()
get the Y Horizontal axis (either GeoY or Lat) |
boolean |
hasTimeAxis()
True if there is a Time Axis. |
boolean |
hasTimeAxis1D()
True if there is a Time Axis and it is 1D. |
boolean |
isDate()
|
static boolean |
isGridCoordSys(Formatter sbuff,
CoordinateSystem cs,
VariableEnhanced v)
Determine if this CoordinateSystem can be made into a GridCoordSys. |
boolean |
isLatLon()
is this a Lat/Lon coordinate system? |
boolean |
isRegularSpatial()
true if x and y axes are CoordinateAxis1D and are regular |
boolean |
isZPositive()
true if increasing z coordinate values means "up" in altitude |
static void |
main(String[] args)
|
static GridCoordSys |
makeGridCoordSys(Formatter sbuff,
CoordinateSystem cs,
VariableEnhanced v)
Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v. |
void |
setProjectionBoundingBox()
Use the bounding box to set the defaule map are of the projection. |
String |
toString()
String representation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ucar.nc2.dt.GridCoordSystem |
---|
getCoordinateAxes, getCoordinateTransforms, getDomain, getName, getProjectionCT, isProductSet |
Constructor Detail |
---|
public GridCoordSys(CoordinateSystem cs, Formatter sbuff)
cs
- create from this Coordinate Systemsbuff
- place information messages here, may be nullpublic GridCoordSys(GridCoordSys from, Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException
from
- copy this GridCoordSyst_range
- subset the time dimension, or null if you want all of itz_range
- subset the vertical dimension, or null if you want all of ity_range
- subset the y dimension, or null if you want all of itx_range
- subset the x dimension, or null if you want all of it
InvalidRangeException
- if any of the ranges are illegalpublic GridCoordSys(GridCoordSys from, Range rt_range, Range e_range, Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException
from
- copy this GridCoordSysrt_range
- subset the runtime dimension, or null if you want all of ite_range
- subset the ensemble dimension, or null if you want all of itt_range
- subset the time dimension, or null if you want all of itz_range
- subset the vertical dimension, or null if you want all of ity_range
- subset the y dimension, or null if you want all of itx_range
- subset the x dimension, or null if you want all of it
InvalidRangeException
- if any of the ranges are illegalMethod Detail |
---|
public static boolean isGridCoordSys(Formatter sbuff, CoordinateSystem cs, VariableEnhanced v)
sbuff
- place information messages here, may be nullcs
- the CoordinateSystem to testv
- can it be used for this variable; v may be null
CoordinateSystem.isGeoReferencing()
public static GridCoordSys makeGridCoordSys(Formatter sbuff, CoordinateSystem cs, VariableEnhanced v)
sbuff
- put debug information into this StringBuffer; may be null.cs
- CoordinateSystem to check.v
- Variable to check.
public VerticalTransform getVerticalTransform()
getVerticalTransform
in interface GridCoordSystem
public VerticalCT getVerticalCT()
getVerticalCT
in interface GridCoordSystem
public CoordinateAxis getXHorizAxis()
getXHorizAxis
in interface GridCoordSystem
public CoordinateAxis getYHorizAxis()
getYHorizAxis
in interface GridCoordSystem
public CoordinateAxis1D getVerticalAxis()
getVerticalAxis
in interface GridCoordSystem
public CoordinateAxis getTimeAxis()
getTimeAxis
in interface GridCoordSystem
public CoordinateAxis1DTime getTimeAxis1D()
getTimeAxis1D
in interface GridCoordSystem
public CoordinateAxis1DTime getRunTimeAxis()
getRunTimeAxis
in interface GridCoordSystem
public CoordinateAxis1D getEnsembleAxis()
getEnsembleAxis
in interface GridCoordSystem
getEnsembleAxis
in class CoordinateSystem
public ProjectionImpl getProjection()
getProjection
in interface GridCoordSystem
getProjection
in class CoordinateSystem
public void setProjectionBoundingBox()
GridCoordSystem
setProjectionBoundingBox
in interface GridCoordSystem
public Date[] getTimeDates()
public boolean isLatLon()
isLatLon
in interface GridCoordSystem
isLatLon
in class CoordinateSystem
public boolean isDate()
public boolean isZPositive()
isZPositive
in interface GridCoordSystem
public boolean isRegularSpatial()
isRegularSpatial
in interface GridCoordSystem
public int[] findXYindexFromCoord(double x_coord, double y_coord, int[] result)
findXYindexFromCoord
in interface GridCoordSystem
x_coord
- position in x coordinate space.y_coord
- position in y coordinate space.result
- put result (x,y) index in here, may be null
public int[] findXYindexFromCoordBounded(double x_coord, double y_coord, int[] result)
findXYindexFromCoordBounded
in interface GridCoordSystem
x_coord
- position in x coordinate space.y_coord
- position in y coordinate space.result
- put result in here, may be null
public int[] findXYindexFromLatLon(double lat, double lon, int[] result)
findXYindexFromLatLon
in interface GridCoordSystem
lat
- latitude position.lon
- longitude position.result
- put result in here, may be null
public int[] findXYindexFromLatLonBounded(double lat, double lon, int[] result)
findXYindexFromLatLonBounded
in interface GridCoordSystem
lat
- latitude position.lon
- longitude position.result
- put result in here, may be null
public int[] findXYCoordElement(double x_coord, double y_coord, int[] result)
public DateRange getDateRange()
GridCoordSystem
getDateRange
in interface GridCoordSystem
public boolean hasTimeAxis()
hasTimeAxis
in interface GridCoordSystem
hasTimeAxis
in class CoordinateSystem
public boolean hasTimeAxis1D()
hasTimeAxis1D
in interface GridCoordSystem
public CoordinateAxis1DTime getTimeAxisForRun(int run_index)
GridCoordSystem
getTimeAxisForRun
in interface GridCoordSystem
run_index
- which run?
public DateUnit getDateUnit() throws Exception
Exception
public TimeUnit getTimeResolution() throws Exception
Exception
- if parsing the time unit failspublic ProjectionRect getBoundingBox()
getBoundingBox
in interface GridCoordSystem
public LatLonPoint getLatLon(int xindex, int yindex)
getLatLon
in interface GridCoordSystem
xindex
- x indexyindex
- y index
public LatLonPoint getLatLon(double xcoord, double ycoord)
public LatLonRect getLatLonBoundingBox()
getLatLonBoundingBox
in interface GridCoordSystem
public List<Range> getLatLonBoundingBox(LatLonRect rect) throws InvalidRangeException
InvalidRangeException
public List<Range> getRangesFromLatLonRect(LatLonRect rect) throws InvalidRangeException
getRangesFromLatLonRect
in interface GridCoordSystem
rect
- the requested lat/lon bounding box
InvalidRangeException
- if llbb generates bad rangespublic String toString()
toString
in class CoordinateSystem
public List<NamedObject> getLevels()
public String getLevelName(int index)
index
- which level coordinate
public int getLevelIndex(String name)
name
- level name
public List<NamedObject> getTimes()
public String getTimeName(int index)
index
- which time coordinate
public int getTimeIndex(String name)
name
- time name
public int findTimeIndexFromDate(Date d)
public static void main(String[] args) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |