Package ucar.nc2
Class FileWriter2
java.lang.Object
ucar.nc2.FileWriter2
Deprecated.
Utility class for copying a NetcdfFile object, or parts of one, to a netcdf-3 or netcdf-4 disk file.
Uses NetcdfFileWriter.
This handles the entire CDM model (groups, etc) if you are writing to netcdf-4.
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 NetcdfFileWriter object for a lower level API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.use ucar.nc2.write.ChunkingIndexstatic enumDeprecated.do not use -
Constructor Summary
ConstructorsConstructorDescriptionFileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.Version version, Nc4Chunking chunker) Deprecated.Use this constructor to copy entire file.FileWriter2(NetcdfFileWriter fileWriter) Deprecated.Use this constructor to copy specific variables to new file. -
Method Summary
Modifier and TypeMethodDescriptionaddVariable(Variable oldVar) Deprecated.Specify which variable will get writtendoublecopyVarData(List<Variable> oldVars, Structure recordVar, CancelTask cancel) Deprecated.Write data from varList into new file.Deprecated.static voidDeprecated.use ucar.nc2.write.Nccopystatic voidsetDebugFlags(DebugFlags debugFlags) Deprecated.Set debugging flagsvoidsetN3StructureStrategy(FileWriter2.N3StructureStrategy n3StructureStrategy) Deprecated.write()Deprecated.write(CancelTask cancel) Deprecated.Write the input file to the output file.
-
Constructor Details
-
FileWriter2
public FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.Version version, Nc4Chunking chunker) throws IOException Deprecated.Use this constructor to copy entire file. Use this.write() to do actual copy.- Parameters:
fileIn- copy this filefileOutName- to this output fileversion- output file versionchunker- chunking strategy (netcdf4 only)- Throws:
IOException- on read/write error
-
FileWriter2
Deprecated.Use this constructor to copy specific variables to new file. Only supports classic mode Use addVariable() to load in variables, then this.write().- Parameters:
fileWriter- this encapsolates new file.
-
-
Method Details
-
setDebugFlags
Deprecated.Set debugging flags- Parameters:
debugFlags- debug flags
-
setN3StructureStrategy
Deprecated. -
getNetcdfFileWriter
Deprecated. -
addVariable
Deprecated.Specify which variable will get written- Parameters:
oldVar- add this variable, and all parent groups- Returns:
- new Variable.
-
write
Deprecated.- Throws:
IOException
-
write
Deprecated.Write the input file to the output file.- Parameters:
cancel- allow user to cancel; may be null.- Returns:
- the open output file.
- Throws:
IOException
-
copyVarData
public double copyVarData(List<Variable> oldVars, Structure recordVar, CancelTask cancel) throws IOException Deprecated.Write data from varList into new file. Read/Write a maximum of maxSize bytes at a time. When theres a record variable, its much more efficient to use it.- Parameters:
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.- Returns:
- total number of bytes written
- Throws:
IOException- if I/O error
-
main
Deprecated.use ucar.nc2.write.Nccopyucar.nc2.FileWriter -in fileIn -out fileOut.where:
- fileIn : path of any CDM readable file
- fileOut: local pathname where netdf-3 file will be written
- Parameters:
arg- -in fileIn -out fileOut [-netcdf4]- Throws:
IOException- on read or write error
-
NetcdfCopier(library) orNccopy(command line)