ncfileBinary.close();
ncfileText.close();
}
void compareIndexes(String fileBinary, String fileText) throws IOException {
GridIndex giB = new GribIndexReader().open(fileBinary + ".gbx8");
GridIndex giT = new GribIndexReader().open(fileText + ".gbx");
// Coordinate systems
List<GridDefRecord> hcsB = giB.getHorizCoordSys();
List<GridDefRecord> hcsT = giT.getHorizCoordSys();
for (int i = 0; i < hcsB.size(); i++) {
GridDefRecord gdrB = hcsB.get(i);
GridDefRecord gdrT = hcsT.get(i);
java.util.Set<String> keysB = gdrB.getKeys();
for (String key : keysB) {
if (key.equals("grid_units") || key.equals("created") || key.equals("location")
|| key.equals("VectorComponentFlag") || key.equals("GDSkey")
|| key.equals("grid_name") || key.equals("scanning_mode")
|| key.equals("grid_shape") )
continue;
String valueB = gdrB.getParam(key);
String valueT = gdrT.getParam(key);
if (!valueB.equals(valueT))
System.out.println("hcs " + key + " differ for Binary and Text " + valueB + " " + valueT);
assert( valueB.equals(valueT) );
}
java.util.Set<String> keysT = gdrT.getKeys();
for (String key : keysT) {
if (key.equals("grid_units") || key.equals("created") || key.equals("location")
|| key.equals("VectorComponentFlag") || key.equals("GDSkey")
|| key.equals("grid_name") || key.equals("ScanningMode")
|| key.equals("grid_shape") )
continue;
String valueB = gdrB.getParam(key);
String valueT = gdrT.getParam(key);
if (!valueT.equals(valueB))
System.out.println("hcs " + key + " differ for Text and Binary " + valueT + " " + valueB);
assert( valueB.equals(valueT) );
}
}
// Attribubutes
Map<String, String> attB = giB.getGlobalAttributes();
Map<String, String> attT = giT.getGlobalAttributes();
java.util.Set<String> keysB = attB.keySet();
for (String key : keysB) {
if (key.equals("basetime") || key.equals("created") || key.equals("location")
|| key.equals("grid_units") || key.equals("ensemble"))
continue;