@Override public Object sendIospMessage(Object special) { if (special instanceof String) { String s = (String) special; if (s.startsWith("gribParameterTableLookup")) { int pos = s.indexOf("="); if (pos > 0) config.gribConfig.lookupTablePath = s.substring(pos + 1).trim(); } else if (s.startsWith("gribParameterTable")) { int pos = s.indexOf("="); if (pos > 0) config.gribConfig.paramTablePath = s.substring(pos + 1).trim(); } if (debug) System.out.printf("GRIB got IOSP message=%s%n", special); return null; } if (special instanceof org.jdom2.Element) { // the root element will be <iospParam> Element root = (org.jdom2.Element) special; config.gribConfig.configFromXml(root, Catalog.ncmlNS); return null; } return super.sendIospMessage(special); }
public void configFromXml(Element configElem, Namespace ns) { String datasetTypes = configElem.getAttributeValue("datasetTypes"); if (null != datasetTypes) addDatasetType(datasetTypes); addGdsHash(gds.getAttributeValue("from"), gds.getAttributeValue("to")); addTimeUnitConvert(tu.getAttributeValue("from"), tu.getAttributeValue("to")); addGdsName(gds.getAttributeValue("hash"), gds.getAttributeValue("groupName")); if (intvFilter == null) intvFilter = new GribIntvFilter(); String excludeZero = intvElem.getAttributeValue("excludeZero"); if (excludeZero != null) setExcludeZero(!excludeZero.equals("false")); String intervalS = intvElem.getAttributeValue("interval"); if (intervalS != null) intvFilter.addInterval(intervalS); String value = param.getAttributeValue("value"); if (name != null && value != null) { setOption(name, value); useGenType = readValue(pdsHashElement, "useGenType", ns, useGenTypeDef); useTableVersion = readValue(pdsHashElement, "useTableVersion", ns, useTableVersionDef); intvMerge = readValue(pdsHashElement, "intvMerge", ns, intvMergeDef); useCenter = readValue(pdsHashElement, "useCenter", ns, useCenterDef);
config.gribConfig.configFromXml(gribConfig, Catalog.defNS);
config.gribConfig.configFromXml(gribConfig, defNS);
config.gribConfig.configFromXml(gribConfig, InvCatalogFactory10.defNS);
config.gribConfig.configFromXml(gribConfig, InvCatalogFactory10.defNS);
public void configFromXml(Element configElem, Namespace ns) { String datasetTypes = configElem.getAttributeValue("datasetTypes"); if (null != datasetTypes) addDatasetType(datasetTypes); addGdsHash(gds.getAttributeValue("from"), gds.getAttributeValue("to")); addTimeUnitConvert(tu.getAttributeValue("from"), tu.getAttributeValue("to")); addGdsName(gds.getAttributeValue("hash"), gds.getAttributeValue("groupName")); readValue(pdsHashElement, "intvMerge", ns, true); readValue(pdsHashElement, "useGenType", ns, false); readValue(pdsHashElement, "useTableVersion", ns, true);
public void configFromXml(Element configElem, Namespace ns) { String datasetTypes = configElem.getAttributeValue("datasetTypes"); if (null != datasetTypes) addDatasetType(datasetTypes); addGdsHash(gds.getAttributeValue("from"), gds.getAttributeValue("to")); addTimeUnitConvert(tu.getAttributeValue("from"), tu.getAttributeValue("to")); addGdsName(gds.getAttributeValue("hash"), gds.getAttributeValue("groupName")); readValue(pdsHashElement, "intvMerge", ns, true); readValue(pdsHashElement, "useGenType", ns, false); readValue(pdsHashElement, "useTableVersion", ns, true);
@Test public void testGdsHashChange() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("NDFD-CONUS_noaaport", "test/NDFD-CONUS_noaaport", FeatureCollectionType.GRIB2, TestDir.cdmUnitTestDir + "gribCollections/gdsHashChange/noaaport/.*gbx9", null, null, null, "file", null); // <gdsHash from='-1506003048' to='-1505079527'/> config.gribConfig.addGdsHash("-1506003048", "-1505079527"); boolean changed = GribCdmIndex.updateGribCollection(config, updateMode, logger); System.out.printf("changed = %s%n", changed); // LOOK add check that records were combined try (NetcdfFile ncfile = NetcdfFile.open(TestDir.cdmUnitTestDir + "gribCollections/gdsHashChange/noaaport/NDFD-CONUS_noaaport.ncx4", null)) { Group root = ncfile.getRootGroup(); Assert.assertEquals(2, root.getGroups().size()); } Grib.setDebugFlags(new DebugFlagsImpl("")); }
@Category(NeedsRdaData.class) @Test public void testRdvamds626p0() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ds626.0_Aggregation", "test/ds626.0", FeatureCollectionType.GRIB2, "D:/work/rdavm/ds626.0/.*gbx9", null, null, null, "directory", null); config.gribConfig.addGdsHash("341801380", "342723940"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Category(NeedsRdaData.class) @Test public void testRdvamds094p2t() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ds094.2_t", "test/ds094.2_t", FeatureCollectionType.GRIB2, "D:\\work\\rdavm\\ds094.2\\timeseries/.*gbx9", null, null, null, "directory", null); config.gribConfig.addGdsHash("341801380", "342723940"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Category(NeedsRdaData.class) @Test public void testRdvamds094p2t_dlw() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ds094.2_t_dlw", "test/ds094.2_t_dlw", FeatureCollectionType.GRIB2, "D:/work/rdavm/ds094.2/timeseries/flxf...gdas.DLWRF.SFC.grb2.gbx9", null, null, null, "directory", null); config.gribConfig.addGdsHash("341801380", "342723940"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Category(NeedsRdaData.class) @Test public void testRdvamds094p1() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ds094.1_Aggregation", "test/ds094.1", FeatureCollectionType.GRIB2, "D:/work/rdavm/ds094.1/**/.*gbx9", null, null, null, "directory", null); config.gribConfig.addGdsHash("341801380", "342723940"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Ignore("B: not visible on spock") @Test public void testRadarNWS() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("radarNWS", "test/radarNWS", FeatureCollectionType.GRIB1, // TestDir.cdmUnitTestDir + "gribCollections/www/.*grib2", "B:/lead/radar/**/.*gbx9", null, null, null, "directory", null); config.gribConfig.setOption("timeUnit", "1 minute"); boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl("")); }
@Category(NeedsRdaData.class) @Test public void testRdvamds094p2dt() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ds094.2_dt", "test/ds094.2_dt", FeatureCollectionType.GRIB2, "D:\\work\\rdavm\\ds094.2\\diurnal_timeseries/.*gbx9", null, null, null, "directory", null); config.gribConfig.addGdsHash("341801380", "342723940"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Category(NeedsRdaData.class) @Test public void testRdvamds094p1p2013() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ds094.1_Test2013", "test/ds094.1", FeatureCollectionType.GRIB2, "D:/work/rdavm/ds094.1/2013/.*gbx9", null, null, null, "directory", null); config.gribConfig.addGdsHash("341801380", "342723940"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Test public void testCfrsAnalysisOnly() throws IOException { // this dataset 0-6 hour forecasts x 124 runtimes (4x31) // there are 2 groups, likely miscoded, the smaller group are 0 hour, duplicates, possibly miscoded FeatureCollectionConfig config = new FeatureCollectionConfig("cfrsAnalysis_46", "test/testCfrsAnalysisOnly", FeatureCollectionType.GRIB2, TestDir.cdmUnitTestDir + "gribCollections/cfsr/.*grb2", null, null, null, "directory", null); // <gdsHash from="1450192070" to="1450218978"/> config.gribConfig.addGdsHash("1450192070", "1450218978"); boolean changed = GribCdmIndex.updateGribCollection(config, updateMode, logger); System.out.printf("changed = %s%n", changed); }
@Test public void createNDFD() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("NDFD-CONUS-5km", "test/NDFD-CONUS-5km", FeatureCollectionType.GRIB2, TestDir.cdmUnitTestDir + "datasets/NDFD-CONUS-5km/.*grib2$", null, null, null, "file", null); config.gribConfig.addGdsHash("-197088379", "-198041691"); config.gribConfig.useGenType = true; boolean changed = GribCdmIndex.updateGribCollection(config, updateMode, logger); System.out.printf("changed = %s%n", changed); }
@Ignore("B: not visible on spock") @Test public void testNdfdNoaaport() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("ndfdNoaaport", "ndfdNoaaport", FeatureCollectionType.GRIB2, "B:/atm/ndfd/.*gbx9", null, null, null, "file", null); config.gribConfig.addGdsHash("-1506003048", "-1505079527"); boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }
@Ignore("B: not visible on spock") @Test public void testGsdHrrSurface() throws IOException { Grib.setDebugFlags(new DebugFlagsImpl("Grib/debugGbxIndexOnly")); FeatureCollectionConfig config = new FeatureCollectionConfig("GSD_HRRR_CONUS_3km_surface", "test/GSD_HRRR_CONUS_3km_surface", FeatureCollectionType.GRIB2, "B:/idd/GSD_HRRR_CONUS_3km_surface/.*gbx9", null, null, null, "file", null); config.gribConfig.setOption("timeUnit", "1 minute"); boolean changed = GribCdmIndex.updateGribCollection(config, CollectionUpdateType.always, logger); System.out.printf("changed = %s%n", changed); Grib.setDebugFlags(new DebugFlagsImpl()); }