//NetcdfFile ncfile = TestH5.open("c:/data/hdf5/HIRDLS/HIRDLS2_v0.3.1-aIrix-c3_2003d106.h5");
NetcdfFile ncfile = TestH5.open(testDir +"HIRDLS2-Aura73p_b029_2000d275.he5");
Group root = ncfile.getRootGroup();
Group g = root.findGroup("HDFEOS INFORMATION");
Variable dset = g.findVariable("StructMetadata.0");
assert(null != dset );
assert(dset.getDataType() == DataType.CHAR);
// read entire array
Array A;
try {
A = dset.read();
}
catch (IOException e) {
System.err.println("ERROR reading file");
assert(false);
return;
}
assert(A.getRank() == 1);
assert (A instanceof ArrayChar);
ArrayChar ca = (ArrayChar) A;
String sval = ca.getString();
System.out.println(dset.getFullName());
System.out.println(" Length = "+sval.length());
System.out.println(" Value = "+sval);
////////////////
dset = g.findVariable("coremetadata.0");
assert(null != dset );
assert(dset.getDataType() == DataType.CHAR);
// read entire array
try {
A = dset.read();
}
catch (IOException e) {
System.err.println("ERROR reading file");
assert(false);
return;
}
assert(A.getRank() == 1);
assert (A instanceof ArrayChar);
ca = (ArrayChar) A;
sval = ca.getString();
System.out.println(dset.getFullName());
System.out.println(" Length = "+sval.length());
System.out.println(" Value = "+sval);
}