Class DoubleScalingScheme

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

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

    • scale

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

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

      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.
    • 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

      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