SEAGrid implements PlanetaryGrid { @Override public double getCenterLat(int row) { return latBin[row]; } SEAGrid();  SEAGrid(int numRows); static int computeRowCount(double res); @Override int getNumRows(); @Override int getNumCols(int row); @Override long getNumBins(); @Override long getFirstBinIndex(int row); @Override double getCenterLat(int row); @Override long getBinIndex(double lat, double lon); @Override int getRowIndex(long binIndex); @Override double[] getCenterLatLon(long binIndex); double getCenterLon(int row, int col); int getColIndex(double lon, int row); int getRowIndex(double lat); static final int DEFAULT_NUM_ROWS; static double RE; }
@Test public void testGetCenterLat() { SEAGrid grid = new SEAGrid(6); try { grid.getCenterLat(-1); fail("ArrayIndexOutOfBoundsException?"); } catch (ArrayIndexOutOfBoundsException e) { } assertEquals(+75.0, grid.getCenterLat(0), 1E-10); assertEquals(+45.0, grid.getCenterLat(1), 1E-10); assertEquals(+15.0, grid.getCenterLat(2), 1E-10); assertEquals(-15.0, grid.getCenterLat(3), 1E-10); assertEquals(-45.0, grid.getCenterLat(4), 1E-10); assertEquals(-75.0, grid.getCenterLat(5), 1E-10); try { grid.getCenterLat(6); fail("ArrayIndexOutOfBoundsException?"); } catch (ArrayIndexOutOfBoundsException e) { } }