@Test
public void testScalarRuntimeCoordinate() throws IOException {
String filename = TestDir.cdmUnitTestDir + "ncss/GFS/CONUS_80km/GFS_CONUS_80km_20120227_0000.grib1.ncx4";
try (DtCoverageDataset gds = DtCoverageDataset.open(filename)) {
Assert.assertNotNull(filename, gds);
String gridName = "Pressure_surface";
DtCoverage grid = gds.findGridByShortName(gridName);
Assert.assertNotNull(gridName, grid);
DtCoverageCS gridCS = grid.getCoordinateSystem();
Assert.assertNotNull("Pressure_surface cs", gridCS);
Assert.assertEquals("ucar.nc2.ft2.coverage.adapter.GridCS", gridCS.getClass().getName());
CoordinateAxis1DTime runAxis = gridCS.getRunTimeAxis();
Assert.assertNotNull("runtime axis", runAxis);
assert runAxis.isScalar();
Formatter errlog = new Formatter();
try (FeatureDatasetCoverage cc = DtCoverageAdapter.factory(gds, errlog)) {
Assert.assertNotNull(filename, cc);
Assert.assertEquals(1, cc.getCoverageCollections().size());
CoverageCollection cd = cc.getCoverageCollections().get(0);
Coverage cov = cd.findCoverage(gridName);
Assert.assertNotNull(gridName, cov);
CoverageCoordAxis cca = cd.findCoordAxis(runAxis.getShortName());
Assert.assertNotNull(runAxis.getShortName(), cca);
Assert.assertEquals(CoverageCoordAxis.Spacing.regularPoint, cca.getSpacing());
}
}
}