Class FloatScalingScheme

java.lang.Object
noaa.coastwatch.util.chunk.FloatScalingScheme
All Implemented Interfaces:
ScalingScheme

public class FloatScalingScheme extends Object implements 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 Details

    • scale

      public float scale
      The scaling factor for float data.
    • offset

      public float offset
      The 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

      public void accept(ScalingSchemeVisitor visitor)
      Description copied from interface: ScalingScheme
      Accepts a visitor in this scheme.
      Specified by:
      accept in interface ScalingScheme
      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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception