}
}
public void testWriteNcml() throws IOException, InvalidRangeException {
final Average fileAvg = new Average();
final NcMLWriter writer = new NcMLWriter();
testAllInDir(new File("C:/data/grib/"), new MClosure() {
public void run(String filename) throws IOException, InvalidRangeException {
if (!filename.endsWith("grib1")) return;
NetcdfFile ncfile = NetcdfDataset.openFile(filename, null);
File fileout = new File(filename + ".ncml");
if (fileout.exists()) fileout.delete();
writer.writeXMLexplicit(ncfile, new FileOutputStream(fileout), null);
System.out.println(" wrote ncml file =" + fileout);
}
});
}