boolean passOne = true;
for (int i = 0; i < products.size(); i++) {
Grib2Product product = products.get(i);
raf.seek(product.getPdsOffset());
PdsReader2 pds = new PdsReader2(raf);
Grib2Pds gpv = pds.pdsVars;
if (passOne) {
System.out.println(" Section = " + gpv.getSection());
System.out.println(" Length = " + gpv.getLength());
System.out.println(" ProductDefinition = " + gpv.getProductDefinitionTemplate());
passOne = false;
}
assert (pds.length == gpv.getLength());
assert (pds.section == gpv.getSection());
assert (pds.coordinates == gpv.getNumberCoordinates());
assert (pds.productDefinition == gpv.getProductDefinitionTemplate());
assert (pds.parameterCategory == gpv.getParameterCategory());
assert (pds.parameterNumber == gpv.getParameterNumber());
if (pds.productDefinition < 20) { // NCEP models
assert (pds.typeGenProcess == gpv.getGenProcessType());
assert (pds.timeRangeUnit == gpv.getTimeUnit());
//System.out.println( i +" "+ pds.forecastTime +" "+ gpv.getForecastTime());
assert (pds.forecastTime == gpv.getForecastTime());
assert (pds.typeFirstFixedSurface == gpv.getLevelType1());
assert (pds.FirstFixedSurfaceValue == gpv.getLevelValue1());
assert (pds.typeSecondFixedSurface == gpv.getLevelType2());
assert (pds.SecondFixedSurfaceValue == gpv.getLevelValue2());
}
if ((pds.productDefinition == 1) || (pds.productDefinition == 11)) {
assert (pds.typeEnsemble == gpv.getPerturbationType());
assert (pds.perturbNumber == gpv.getPerturbationNumber());
assert (pds.numberForecasts == gpv.getNumberEnsembleForecasts());
} else if (pds.productDefinition == 2) {
assert (pds.typeEnsemble == gpv.getPerturbationType());
assert (pds.numberForecasts == gpv.getNumberEnsembleForecasts());
} else if (pds.productDefinition == 5) {
assert (pds.typeEnsemble == gpv.getPerturbationType());
assert (pds.lowerLimit == gpv.getProbabilityLowerLimit());
assert (pds.upperLimit == gpv.getProbabilityUpperLimit());
} else if (pds.productDefinition == 9) {
assert (pds.typeEnsemble == gpv.getPerturbationType());
assert (pds.numberForecasts == gpv.getNumberEnsembleForecasts());
// probability type
assert (pds.lowerLimit == gpv.getProbabilityLowerLimit());
assert (pds.upperLimit == gpv.getProbabilityUpperLimit());
}
pds = null;
}
products = null;