public class CFNC4Writer extends EarthDataWriter
A CF NetCDF 4 writer creates NetCDF 4 format files with CF metadata using the Nujan NetCDF 4 writing library.
Some implementation notes:
DataVariable.getUnsigned()
flag), it is written as
signed data of the next largest NetCDF data type.info, isCanceled, variables, writeProgress, writeVariableName, writeVariables
Constructor and Description |
---|
CFNC4Writer(EarthDataInfo info,
java.lang.String file)
Creates a new NetCDF 4 file from the specified info and file
name.
|
CFNC4Writer(EarthDataInfo info,
java.lang.String file,
boolean writeDcs,
boolean writeCw)
Creates a new NetCDF 4 file from the specified info and file
name.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the writer and frees any resources.
|
void |
flush()
Flushes all unwritten data to the destination.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
addVariable, cancel, finalize, getDestination, getProgress, getProgressLength, getProgressVariable
public CFNC4Writer(EarthDataInfo info, java.lang.String file) throws java.io.IOException
info
- the earth data info object.file
- the new NetCDF file name.java.io.IOException
- if an error occurred creating the file
or writing the initial data.public CFNC4Writer(EarthDataInfo info, java.lang.String file, boolean writeDcs, boolean writeCw) throws java.io.IOException
info
- the earth data info object.file
- the new NetCDF file name.writeDcs
- DCS metadata flag, true to write DCS
attributes.writeCw
- CW metadata flag, true to write CW
attributes.java.io.IOException
- if an error occurred creating the file
or writing the initial data.public void flush() throws java.io.IOException
EarthDataWriter
flush
in class EarthDataWriter
java.io.IOException
- if the data destination had I/O errors.public void close() throws java.io.IOException
EarthDataWriter
flush
method is called prior to closing.close
in class EarthDataWriter
java.io.IOException
- if the data destination had I/O errors.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception