dk.dmi.jog
Class MiscArrays

java.lang.Object
  extended bydk.dmi.jog.MiscArrays

public final class MiscArrays
extends Object

Static methods for various array operations. Missing values must be represented by Float.NaN.


Method Summary
static List asList(float[] f)
          Returns a fixed-size list backed by the specified array.
static List asList(float[][][][] f)
          Returns a fixed-size list backed by the specified array.
static float[] interpolateCenteredLinear(float[] a)
          Returns a version of the argument array with missing values interpolated using a centered linear interpolation.
static float[] interpolateLeftLinear(float[] a)
          Returns a version of the argument array with missing values interpolated using a one-sided linear interpolation.
static float[][][][] mask(float[][][][] d, boolean[][][][] m)
          Returns a 4-dimensional float array identical to the first argument but with data values set to Float.NaN where the second argument is false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

asList

public static List asList(float[] f)
Returns a fixed-size list backed by the specified array.

Parameters:
f - the array by which the list will be backed.
Returns:
a fixed-size list backed by the specified array.

asList

public static List asList(float[][][][] f)
Returns a fixed-size list backed by the specified array.

Parameters:
f - the array by which the list will be backed.
Returns:
a fixed-size list backed by the specified array.

interpolateCenteredLinear

public static float[] interpolateCenteredLinear(float[] a)
Returns a version of the argument array with missing values interpolated using a centered linear interpolation. No extrapolation is performed.

Parameters:
a - array to be interpolated.
Returns:
a version of the argument array with missing values interpolated using a centered linear interpolation.

interpolateLeftLinear

public static float[] interpolateLeftLinear(float[] a)
Returns a version of the argument array with missing values interpolated using a one-sided linear interpolation. (Not implemented).

Parameters:
a - array to be interpolated.
Returns:
a version of the argument array with missing values interpolated using a one-sided linear interpolation.

mask

public static float[][][][] mask(float[][][][] d,
                                 boolean[][][][] m)
Returns a 4-dimensional float array identical to the first argument but with data values set to Float.NaN where the second argument is false

Parameters:
d - input data.
m - input mask.
Returns:
a 4-dimensional float array identical to the first argument but with data values masked out where the second argument is false