Package noaa.coastwatch.util.chunk
Class DoubleScalingScheme
java.lang.Object
noaa.coastwatch.util.chunk.DoubleScalingScheme
- All Implemented Interfaces:
ScalingScheme
The
DoubleScalingScheme
class implements a scale and offset
for scaling double data. Double values are scaled as
scaled = (raw - offset)*scale
.- Since:
- 3.6.1
- Author:
- Peter Hollemans
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDoubleScalingScheme
(double scale, double 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.double
scaleDouble
(double value) Scales a raw double value.void
scaleDoubleData
(double[] rawData, double[] scaledData) Scales raw double data.double
unscaleDouble
(double value) Unscales a double value.void
unscaleDoubleData
(double[] scaledData, double[] rawData) Unscales double data.
-
Field Details
-
scale
public double scaleThe scaling factor for double data. -
offset
public double offsetThe offset for double data.
-
-
Constructor Details
-
DoubleScalingScheme
public DoubleScalingScheme(double scale, double 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.
-
scaleDoubleData
public void scaleDoubleData(double[] rawData, double[] scaledData) Scales raw double data.- Parameters:
rawData
- the raw unscaled array to read.scaledData
- the scaled array to write.
-
unscaleDoubleData
public void unscaleDoubleData(double[] scaledData, double[] rawData) Unscales double data.- Parameters:
scaledData
- the scaled array to read.rawData
- the raw unscaled array to write.
-
scaleDouble
public double scaleDouble(double value) Scales a raw double value.- Parameters:
value
- the raw value to scale.- Returns:
- the scaled value.
-
unscaleDouble
public double unscaleDouble(double value) Unscales a double value.- Parameters:
value
- the value to unscale.- Returns:
- the unscaled value.
-
equals
-
hashCode
public int hashCode() -
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-