public class FileWriter2 extends Object
Use a NetcdfFileWriter object for a lower level API.
CFGridWriter2,
ucar.nc2.ft.point.writer.CFPointWriter| Modifier and Type | Class and Description |
|---|---|
static class |
FileWriter2.ChunkingIndex
An index that computes chunk shapes.
|
static class |
FileWriter2.N3StructureStrategy |
| Constructor and Description |
|---|
FileWriter2(NetcdfFile fileIn,
String fileOutName,
NetcdfFileWriter.Version version,
ucar.nc2.write.Nc4Chunking chunker)
Use this constructor to copy entire file.
|
FileWriter2(NetcdfFileWriter fileWriter)
Use this constructor to copy specific variables to new file.
|
| Modifier and Type | Method and Description |
|---|---|
Variable |
addVariable(Variable oldVar)
Specify which variable will get written
|
double |
copyVarData(List<Variable> oldVars,
Structure recordVar,
CancelTask cancel)
Write data from varList into new file.
|
NetcdfFileWriter |
getNetcdfFileWriter() |
static void |
main(String[] arg)
Better to use ucar.nc.dataset.NetcdfDataset main program instead.
|
static void |
setDebugFlags(DebugFlags debugFlags)
Set debugging flags
|
void |
setN3StructureStrategy(FileWriter2.N3StructureStrategy n3StructureStrategy) |
NetcdfFile |
write() |
NetcdfFile |
write(CancelTask cancel)
Write the input file to the output file.
|
public FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.Version version, ucar.nc2.write.Nc4Chunking chunker) throws IOException
fileIn - copy this filefileOutName - to this output fileversion - output file versionchunker - chunking strategy (netcdf4 only)IOException - on read/write errorpublic FileWriter2(NetcdfFileWriter fileWriter) throws IOException
fileWriter - this encapsolates new file.IOException - on read/write errorpublic static void setDebugFlags(DebugFlags debugFlags)
debugFlags - debug flagspublic void setN3StructureStrategy(FileWriter2.N3StructureStrategy n3StructureStrategy)
public NetcdfFileWriter getNetcdfFileWriter()
public Variable addVariable(Variable oldVar)
oldVar - add this variable, and all parent groupspublic NetcdfFile write() throws IOException
IOExceptionpublic NetcdfFile write(CancelTask cancel) throws IOException
cancel - allow user to cancel; may be null.IOExceptionpublic double copyVarData(List<Variable> oldVars, Structure recordVar, CancelTask cancel) throws IOException
oldVars - list of variables from the original file, with data in themrecordVar - the record variable from the original file, or null means dont use record variablescancel - allow user to cancel, may be null.IOException - if I/O errorpublic static void main(String[] arg) throws IOException
ucar.nc2.FileWriter -in fileIn -out fileOut.
where:
arg - -in fileIn -out fileOut [-netcdf4]IOException - on read or write error