public class ArcWriter extends FloatWriter
DEFAULT_CHUNK_SIZE, HOST, LSB, MSB
info, isCanceled, variables, writeProgress, writeVariableName, writeVariables
Constructor and Description |
---|
ArcWriter(EarthDataInfo info,
java.lang.String file)
Creates a new binary file from the specified earth data info
and file name.
|
Modifier and Type | Method and Description |
---|---|
void |
addVariable(DataVariable var)
Adds a data variable to the writer.
|
void |
flush()
Flushes all unwritten data to the destination.
|
void |
setMissing(java.lang.Number missing)
Sets the missing value.
|
void |
setOrder(int order)
Sets the byte order.
|
protected void |
writeHeader(DataVariable var)
Writes an Arc header file.
|
convertValue, getDefaultMissing, getTypeMax, getTypeMin, getTypeRange, setRange, setScaling
byteSwap, close, getBytes, getBytes, setHeader, writeVariable
cancel, finalize, getDestination, getProgress, getProgressLength, getProgressVariable
public ArcWriter(EarthDataInfo info, java.lang.String file) throws java.io.IOException
info
- the earth data info object.file
- the new binary file name.java.io.IOException
- if an error occurred opening the file.FloatWriter.FloatWriter(noaa.coastwatch.util.EarthDataInfo, java.lang.String)
,
BinaryWriter.BinaryWriter(noaa.coastwatch.util.EarthDataInfo, java.lang.String)
public void addVariable(DataVariable var)
EarthDataWriter
method so that
only one variable may be present in the variable list. Note that
only variables of type Grid
are accepted; other
types are silently ignored.addVariable
in class EarthDataWriter
var
- the data variable to add.EarthDataWriter.addVariable(noaa.coastwatch.util.DataVariable)
public void setOrder(int order)
MSB
.setOrder
in class BinaryWriter
order
- the byte order. The options are HOST
for host byte order, MSB
for most significant byte
first and LSB
for least significant byte first.public void setMissing(java.lang.Number missing)
-3.4e38
.setMissing
in class BinaryWriter
missing
- the missing value. The missing value is used to
represent missing or out of range data. If null, the missing
value is set to the default.public void flush() throws java.io.IOException
BinaryWriter
method so that only one
variable is ever actually flushed to the destination.flush
in class BinaryWriter
java.io.IOException
- if the data destination had I/O errors.protected void writeHeader(DataVariable var) throws java.io.IOException
nrows (number of data rows) ncols (number of data columns) xllcorner (lower left corner x coordinate in map coordinates) yllcorner (lower left corner y coordinate in map coordinates) cellsize (size of each grid cell in map coordinates) nodata_value (missing data value) byteorder (byte order as "LSBFIRST" or "MSBFIRST") nbits 32The name of the header file is derived from the output file name by replacing any '.' followed by an extension with '.hdr'.
writeHeader
in class BinaryWriter
var
- the data variable to write a header for.java.io.IOException
- if an error occurred writing the header data
to the file.