Package uk.ac.rdg.resc.edal.util
Class LookUpTable
- java.lang.Object
-
- uk.ac.rdg.resc.edal.util.LookUpTable
-
public final class LookUpTable extends Object
An object that provides an approximate means for mapping from longitude-latitude coordinates to i and j index coordinates in a curvilinear grid.- Author:
- Guy Griffiths, Jon
-
-
Constructor Summary
Constructors Constructor Description LookUpTable(CurvilinearCoords curvCoords, double minResolution)
Creates an empty look-up table (with all indices set to -1).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int[]
getGridCoordinates(double longitude, double latitude)
Returns the nearest coordinates in the original CurvilinearGrid to the given longitude-latitude point, or null if the given longitude-latitude point is not in the domain of this look-up table.int
getNumLatPoints()
Gets the number of points in this look-up table along its latitude axisint
getNumLonPoints()
Gets the number of points in this look-up table along its longitude axisint
hashCode()
-
-
-
Constructor Detail
-
LookUpTable
public LookUpTable(CurvilinearCoords curvCoords, double minResolution)
Creates an empty look-up table (with all indices set to -1).- Parameters:
curvCoords
- TheCurvilinearCoords
which this LUT will approximateminResolution
- The minimum resolution of the LUT in degrees
-
-
Method Detail
-
getGridCoordinates
public int[] getGridCoordinates(double longitude, double latitude)
Returns the nearest coordinates in the original CurvilinearGrid to the given longitude-latitude point, or null if the given longitude-latitude point is not in the domain of this look-up table.- Parameters:
longitude
- The longitude of the point of interestlatitude
- The latitude of the point of interest- Returns:
- A newly-created integer array with two values: the first value is the i coordinate in the grid, the second is the j coordinate. Returns null if the given longitude-latitude point is not in the domain of this LUT.
-
getNumLonPoints
public int getNumLonPoints()
Gets the number of points in this look-up table along its longitude axis
-
getNumLatPoints
public int getNumLatPoints()
Gets the number of points in this look-up table along its latitude axis
-
-