@Test public void testReadData() throws IOException { GridDatatype g = gds.findGridDatatype("IR_WV"); assert null != g; assert g.getFullName().equals("IR_WV"); assert g.getRank() == 3; assert g.getShape()[0] == ntimes; assert g.getShape()[1] == 1008; assert g.getShape()[2] == 1536; assert g.getDataType() == DataType.USHORT : g.getDataType(); GridCoordSystem gsys = g.getCoordinateSystem(); assert gsys.getXHorizAxis() != null; assert gsys.getYHorizAxis() != null; assert gsys.getTimeAxis() != null; assert gsys.getVerticalAxis() == null; assert gsys.getProjection() != null; Array data = g.readVolumeData(0); assert data.getRank() == 2; assert data.getShape()[0] == 1008; assert data.getShape()[1] == 1536; assert data.getElementType() == short.class; } }
@Test public void testJoinNewWithGroups() throws IOException, InvalidRangeException { String location = TestDir.cdmUnitTestDir + "agg/groups/groupsJoinNew.ncml"; GridDataset ncd = null; try { ncd = GridDataset.open(location); // fails here GridDatatype v = ncd.findGridDatatype("All_Data/Lifted_Index"); // the only agg var assert v != null; assert v.getRank() == 3; Section s = new Section(v.getShape()); //assert s.equals(new Section(new int[] {2, 44, 60})) : s ; v = ncd.findGridDatatype("All_Data/CAPE"); // random non-agg var assert v != null; assert v.getRank() == 2; Array a = v.readVolumeData(0); System.out.printf("array section for %s = %s%n", v, new Section(a.getShape())); } finally { if (ncd != null) ncd.close(); } } }
Assert.assertArrayEquals(expectShape, grid.getShape());
Assert.assertArrayEquals(expectShape, grid.getShape());