Package org.esa.snap.core.util.math
Class VectorLookupTable
java.lang.Object
org.esa.snap.core.util.math.VectorLookupTable
The class
VectorLookupTable performs the function of
multilinear interpolation for vector lookup tables with an
arbitrary number of dimensions.
todo - method for degrading a table (see LookupTable)
-
Constructor Summary
ConstructorsConstructorDescriptionVectorLookupTable(int length, double[] values, double[]... dimensions) Constructs an array lookup table for the lookup values and dimensions supplied as arguments.VectorLookupTable(int length, double[] values, IntervalPartition... dimensions) Constructs an array lookup table for the lookup values and dimensions supplied as arguments.VectorLookupTable(int length, float[] values, float[]... dimensions) Constructs an array lookup table for the lookup values and dimensions supplied as arguments.VectorLookupTable(int length, float[] values, IntervalPartition... dimensions) Constructs an array lookup table for the lookup values and dimensions supplied as arguments. -
Method Summary
Modifier and TypeMethodDescriptionfinal IntervalPartitiongetDimension(int i) Returns the the ith dimension associated with the lookup table.final intReturns the number of dimensions associated with the lookup table.final IntervalPartition[]Returns the dimensions associated with the lookup table.final double[]getValues(double... coordinates) Returns an interpolated value array for the given coordinates.
-
Constructor Details
-
VectorLookupTable
Constructs an array lookup table for the lookup values and dimensions supplied as arguments.- Parameters:
length- the length of the lookup vector.values- the lookup values. Thevaluesarray must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.dimensions- the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, seeIntervalPartition.- Throws:
IllegalArgumentException- iflengthis less than1or the length ofvaluesis not equal tolengthtimes the number of coordinate grid vertices.NullPointerException- if thevaluesarray or thedimensionsarray isnullor any dimension isnull.
-
VectorLookupTable
Constructs an array lookup table for the lookup values and dimensions supplied as arguments.- Parameters:
length- the length of the lookup vector.values- the lookup values. Thevaluesarray must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.dimensions- the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, seeIntervalPartition.- Throws:
IllegalArgumentException- iflengthis less than1or the length ofvaluesis not equal tolengthtimes the number of coordinate grid vertices.NullPointerException- if thevaluesarray or thedimensionsarray isnullor any dimension isnull.
-
VectorLookupTable
public VectorLookupTable(int length, double[] values, double[]... dimensions) Constructs an array lookup table for the lookup values and dimensions supplied as arguments.- Parameters:
length- the length of the lookup vector.values- the lookup values. Thevaluesarray must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.dimensions- the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, seeIntervalPartition.- Throws:
IllegalArgumentException- iflengthis less than1or the length ofvaluesis not equal tolengthtimes the number of coordinate grid vertices.NullPointerException- if thevaluesarray or thedimensionsarray isnullor any dimension isnull.
-
VectorLookupTable
public VectorLookupTable(int length, float[] values, float[]... dimensions) Constructs an array lookup table for the lookup values and dimensions supplied as arguments.- Parameters:
length- the length of the lookup vector.values- the lookup values. Thevaluesarray must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.dimensions- the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, seeIntervalPartition.- Throws:
IllegalArgumentException- iflengthis less than1or the length ofvaluesis not equal tolengthtimes the number of coordinate grid vertices.NullPointerException- if thevaluesarray or thedimensionsarray isnullor any dimension isnull.
-
-
Method Details
-
getDimensionCount
public final int getDimensionCount()Returns the number of dimensions associated with the lookup table.- Returns:
- the number of dimensions.
-
getDimensions
Returns the dimensions associated with the lookup table.- Returns:
- the dimensions.
-
getDimension
Returns the the ith dimension associated with the lookup table.- Parameters:
i- the index number of the dimension of interest- Returns:
- the ith dimension.
-
getValues
Returns an interpolated value array for the given coordinates.- Parameters:
coordinates- the coordinates of the lookup point.- Returns:
- the interpolated value array.
- Throws:
IllegalArgumentException- if the length of thecoordinatesarray is not equal to the number of dimensions associated with the lookup table.NullPointerException- if thecoordinatesarray isnull.
-