Class ChunkDataCast

java.lang.Object
noaa.coastwatch.util.chunk.ChunkDataCast

public class ChunkDataCast extends Object
Performs data type casting operations to and from DataChunk objects.
Since:
3.8.0
Author:
Peter Hollemans
  • Constructor Details

    • ChunkDataCast

      public ChunkDataCast()
  • Method Details

    • toFloatArray

      public static void toFloatArray(DataChunk chunk, float[] floatArray)
      Casts the data values from a DataChunk object into a primitive float array.
      Parameters:
      chunk - the chunk to cast.
      floatArray - the primitive float array to fill with data. Missing values in the chunk are marked as Float.NaN in the primitive array.
    • toDoubleArray

      public static void toDoubleArray(DataChunk chunk, double[] doubleArray)
      Casts the data values from a DataChunk object into a primitive double array.
      Parameters:
      chunk - the chunk to cast.
      doubleArray - the primitive double array to fill with data. Missing values in the chunk are marked as Double.NaN in the primitive array.
      Since:
      3.8.1
    • fromFloatArray

      public static void fromFloatArray(float[] floatArray, DataChunk chunk)
      Casts the data values to a DataChunk object from a primitive float array.
      Parameters:
      floatArray - the primitive float array to use for data. Float.NaN values in the primitive array are marked as missing in the chunk.
      chunk - the chunk to modify.