return 1;
} */
private int analalyseIntervals(String filename) throws IOException {
NetcdfFile ncd = NetcdfFile.open(filename);
nfiles++;
//System.out.printf("==============================================================================%n");
GribGridServiceProvider iosp = (GribGridServiceProvider) ncd.getIosp();
GridIndex index = (GridIndex) iosp.sendIospMessage("GridIndex");
Map<Integer, Product> pdsSet = new HashMap<Integer, Product>();
List<GridRecord> grList = index.getGridRecords();
for (GridRecord gr : grList) {
GribGridRecord ggr = (GribGridRecord) gr;
GribPds pds = ggr.getPds();
if (!pds.isInterval()) continue;
//int startInterval = ggr.startOfInterval;
//if ((startInterval == GribNumbers.UNDEFINED) || (startInterval == GribNumbers.MISSING)) continue;
/* check valid time == base time + forecast
int forecast = ggr.forecastTime;
Date validTime = ggr.getValidTime();
Date refTime = ggr.getReferenceTime();
if (forecast != startInterval) {
String name = ParameterTable.getParameterName(ggr.discipline, ggr.category, ggr.paramNumber) +"/" + Grib2Tables.codeTable4_5(ggr.levelType1);
System.out.printf(" **time %s %d != %d%n", name, forecast, startInterval);
} */
Product bean = pdsSet.get(ggr.cdmVariableHash());
if (bean == null) {
bean = new Product(ggr);
pdsSet.put(ggr.cdmVariableHash(), bean);
nintVars++;
}
bean.list.add(ggr);
}
List<Product> sortList = new ArrayList<Product>();
sortList.addAll(pdsSet.values());
Collections.sort(sortList);
for (Product p : sortList) {
p.sort();
System.out.printf(" %s (%d)%n", p.name, p.ggr.getPds().getParameterNumber());
System.out.printf("%s%n", p.doAccumAlgo(false));
}
ncd.close();
return 1;
}