Package noaa.coastwatch.io
Class FloatWriter
java.lang.Object
noaa.coastwatch.io.EarthDataWriter
noaa.coastwatch.io.BinaryWriter
noaa.coastwatch.io.FloatWriter
- Direct Known Subclasses:
ArcWriter
A float writer is a binary writer that writes data as a stream of
32-bit IEEE floating point values. The scaling and range methods
are not supported and perform no function for 32-bit float data.
- Since:
- 3.1.0
- Author:
- Mark Robinson
-
Field Summary
Fields inherited from class noaa.coastwatch.io.BinaryWriter
DEFAULT_CHUNK_SIZE, HOST, LSB, MSB
Fields inherited from class noaa.coastwatch.io.EarthDataWriter
info, isCanceled, variables, writeProgress, writeVariableName, writeVariables
-
Constructor Summary
ConstructorDescriptionFloatWriter
(EarthDataInfo info, String file) Creates a new binary file from the specified earth data info and file name. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convertValue
(Number value) Converts a data value to a byte array.Gets the default missing value.double
Gets the type maximum as a double.double
Gets the type minimum as a double.double
Throws an error because this method should never be called for this class.void
setRange
(double min, double max) Sets the scaling range.void
setScaling
(double[] scaling) Sets the scaling factor and offset.Methods inherited from class noaa.coastwatch.io.BinaryWriter
byteSwap, close, flush, getBytes, getBytes, setHeader, setMissing, setOrder, writeHeader, writeVariable
Methods inherited from class noaa.coastwatch.io.EarthDataWriter
addVariable, cancel, finalize, getDestination, getProgress, getProgressLength, getProgressVariable
-
Constructor Details
-
FloatWriter
Creates a new binary file from the specified earth data info and file name.- Parameters:
info
- the earth data info object.file
- the new binary file name.- Throws:
IOException
- if an error occurred opening the file.- See Also:
-
-
Method Details
-
setRange
public void setRange(double min, double max) Sets the scaling range. This method overrides the super class and simply sets the scaling to unity; scaling is not supported here.- Overrides:
setRange
in classBinaryWriter
- Parameters:
min
- the minimum data value.max
- the maximum data value.
-
setScaling
public void setScaling(double[] scaling) Sets the scaling factor and offset. This method overrides the super class and simply sets the scaling to unity; scaling is not supported here.- Overrides:
setScaling
in classBinaryWriter
- Parameters:
scaling
- the scaling as [factor, offset]. If null, [1,0] is used.
-
convertValue
Description copied from class:BinaryWriter
Converts a data value to a byte array. The byte array has a length appropriate for the subclass. The value must be in the rangegetTypeMin()
togetTypeMax()
.- Specified by:
convertValue
in classBinaryWriter
- Parameters:
value
- the value for conversion.- Returns:
- an array of bytes.
-
getTypeMin
public double getTypeMin()Description copied from class:BinaryWriter
Gets the type minimum as a double.- Specified by:
getTypeMin
in classBinaryWriter
-
getTypeMax
public double getTypeMax()Description copied from class:BinaryWriter
Gets the type maximum as a double.- Specified by:
getTypeMax
in classBinaryWriter
-
getTypeRange
public double getTypeRange()Throws an error because this method should never be called for this class.- Specified by:
getTypeRange
in classBinaryWriter
-
getDefaultMissing
Description copied from class:BinaryWriter
Gets the default missing value.- Specified by:
getDefaultMissing
in classBinaryWriter
-