Package noaa.coastwatch.util.chunk
Class FloatScalingScheme
java.lang.Object
noaa.coastwatch.util.chunk.FloatScalingScheme
- All Implemented Interfaces:
ScalingScheme
The
FloatScalingScheme
class implements a scale and offset
for scaling float data. Float values are scaled as
scaled = (raw - offset)*scale
.- Since:
- 3.6.1
- Author:
- Peter Hollemans
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFloatScalingScheme
(float scale, float offset) Creates a new scaling instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ScalingSchemeVisitor visitor) Accepts a visitor in this scheme.boolean
int
hashCode()
static void
Tests this class.float
scaleFloat
(float value) Scales a raw float value.void
scaleFloatData
(float[] rawData, float[] scaledData) Scales raw float data.float
unscaleFloat
(float value) Unscales a float value.void
unscaleFloatData
(float[] scaledData, float[] rawData) Unscales float data.
-
Field Details
-
scale
public float scaleThe scaling factor for float data. -
offset
public float offsetThe offset for float data.
-
-
Constructor Details
-
FloatScalingScheme
public FloatScalingScheme(float scale, float offset) Creates a new scaling instance.- Parameters:
scale
- the scaling factor.offset
- the offset value.
-
-
Method Details
-
accept
Description copied from interface:ScalingScheme
Accepts a visitor in this scheme.- Specified by:
accept
in interfaceScalingScheme
- Parameters:
visitor
- the visitor to accept.
-
scaleFloatData
public void scaleFloatData(float[] rawData, float[] scaledData) Scales raw float data.- Parameters:
rawData
- the raw unscaled array to read.scaledData
- the scaled array to write.
-
unscaleFloatData
public void unscaleFloatData(float[] scaledData, float[] rawData) Unscales float data.- Parameters:
scaledData
- the scaled array to read.rawData
- the unscaled array to write.
-
scaleFloat
public float scaleFloat(float value) Scales a raw float value.- Parameters:
value
- the raw value to scale.- Returns:
- the scaled value.
-
unscaleFloat
public float unscaleFloat(float value) Unscales a float value.- Parameters:
value
- the value to unscale.- Returns:
- the raw unscaled value.
-
equals
-
hashCode
public int hashCode() -
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-