public class FileWriter2
extends java.lang.Object
Use a NetcdfFileWriter object for a lower level API.
CFGridWriter2
,
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,
java.lang.String fileOutName,
NetcdfFileWriter.Version version,
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(java.util.List<Variable> oldVars,
Structure recordVar,
CancelTask cancel)
Write data from varList into new file.
|
NetcdfFileWriter |
getNetcdfFileWriter() |
static void |
main(java.lang.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, java.lang.String fileOutName, NetcdfFileWriter.Version version, Nc4Chunking chunker) throws java.io.IOException
fileIn
- copy this filefileOutName
- to this output fileversion
- output file versionchunker
- chunking strategy (netcdf4 only)java.io.IOException
- on read/write errorpublic FileWriter2(NetcdfFileWriter fileWriter) throws java.io.IOException
fileWriter
- this encapsolates new file.java.io.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 java.io.IOException
java.io.IOException
public NetcdfFile write(CancelTask cancel) throws java.io.IOException
cancel
- allow user to cancel; may be null.java.io.IOException
public double copyVarData(java.util.List<Variable> oldVars, Structure recordVar, CancelTask cancel) throws java.io.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.java.io.IOException
- if I/O errorpublic static void main(java.lang.String[] arg) throws java.io.IOException
ucar.nc2.FileWriter -in fileIn -out fileOut.
where:
arg
- -in fileIn -out fileOut [-netcdf4]java.io.IOException
- on read or write error