Package ucar.nc2.write
Class NetcdfCopier
- java.lang.Object
-
- ucar.nc2.write.NetcdfCopier
-
public class NetcdfCopier extends Object
Utility class for copying a NetcdfFile object, or parts of one, to a netcdf-3 or netcdf-4 disk file. This handles the entire CDM model (groups, etc) if you are writing to netcdf-4. If copying from an extended model to classic model, Strings are converted to Chars; nested groups are not allowed. The fileIn may be an NcML file which has a referenced dataset in the location URL, 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. Use Nccopy for a command line interface. Use NetcdfFormatWriter object for a lower level API.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NetcdfCopier
create(NetcdfFile fileIn, NetcdfFormatWriter.Builder ncwriter)
static void
setDebugFlags(DebugFlags debugFlags)
NetcdfFile
write(CancelTask cancel)
Write the input file to the output file.
-
-
-
Method Detail
-
setDebugFlags
public static void setDebugFlags(DebugFlags debugFlags)
-
create
public static NetcdfCopier create(NetcdfFile fileIn, NetcdfFormatWriter.Builder ncwriter)
-
write
public NetcdfFile write(@Nullable CancelTask cancel) throws IOException
Write the input file to the output file.- Parameters:
cancel
- allow user to cancel; may be null.- Returns:
- the open output file. User must close it.
- Throws:
IOException
-
-