/** * Read an NcML and write an equivalent NetcdfFile to a physical file, using Netcdf-3 file format. * The NcML may have a referenced dataset in the location URL, in which case the underlying data * (modified by the NcML) is written to the new file. If the NcML does not have a referenced dataset, * then the new file is filled with fill values, like ncgen. * * @param ncml read NcML from this input stream * @param fileOutName write to this local file * @throws IOException on error * @see ucar.nc2.FileWriter2 */ public static void writeNcMLToFile(InputStream ncml, String fileOutName) throws IOException { writeNcMLToFile(ncml, fileOutName, NetcdfFileWriter.Version.netcdf3, null); }
/** * Read an NcML and write an equivalent NetcdfFile to a physical file, using Netcdf-3 file format. * The NcML may have a referenced dataset in the location URL, in which case the underlying data * (modified by the NcML) is written to the new file. If the NcML does not have a referenced dataset, * then the new file is filled with fill values, like ncgen. * * @param ncml read NcML from this input stream * @param fileOutName write to this local file * @throws IOException on error * @see ucar.nc2.FileWriter2 */ public static void writeNcMLToFile(InputStream ncml, String fileOutName) throws IOException { writeNcMLToFile(ncml, fileOutName, NetcdfFileWriter.Version.netcdf3, null); }
/** * Read an NcML and write an equivalent NetcdfFile to a physical file, using Netcdf-3 file format. * The NcML may have a referenced dataset in the location URL, in which case the underlying data * (modified by the NcML) is written to the new file. If the NcML does not have a referenced dataset, * then the new file is filled with fill values, like ncgen. * * @param ncml read NcML from this input stream * @param fileOutName write to this local file * @throws IOException on error * @see ucar.nc2.FileWriter2 */ public static void writeNcMLToFile(InputStream ncml, String fileOutName) throws IOException { writeNcMLToFile(ncml, fileOutName, NetcdfFileWriter.Version.netcdf3, null); }
public static void main(String arg[]) { String ncmlFile = "C:/data/AStest/oots/test.ncml"; String ncmlFileOut = "C:/TEMP/testNcmlOut.nc"; try { //NetcdfDataset ncd = NcMLReader.readNcML (ncmlFile, null); //ncd.writeNcMLG(System.out, true, null); //System.out.println("NcML = "+ncmlFile); InputStream in = new FileInputStream(ncmlFile); writeNcMLToFile(in, ncmlFileOut); } catch (Exception ioe) { System.out.println("error = " + ncmlFile); ioe.printStackTrace(); } }
public static void main(String arg[]) { String ncmlFile = "C:/data/AStest/oots/test.ncml"; String ncmlFileOut = "C:/TEMP/testNcmlOut.nc"; try { //NetcdfDataset ncd = NcMLReader.readNcML (ncmlFile, null); //ncd.writeNcMLG(System.out, true, null); //System.out.println("NcML = "+ncmlFile); InputStream in = new FileInputStream(ncmlFile); writeNcMLToFile(in, ncmlFileOut); } catch (Exception ioe) { System.out.println("error = " + ncmlFile); ioe.printStackTrace(); } }
public static void main(String arg[]) { String ncmlFile = "C:/data/AStest/oots/test.ncml"; String ncmlFileOut = "C:/TEMP/testNcmlOut.nc"; try { //NetcdfDataset ncd = NcMLReader.readNcML (ncmlFile, null); //ncd.writeNcMLG(System.out, true, null); //System.out.println("NcML = "+ncmlFile); InputStream in = new FileInputStream(ncmlFile); writeNcMLToFile(in, ncmlFileOut); } catch (Exception ioe) { System.out.println("error = " + ncmlFile); ioe.printStackTrace(); } }