hydroScalingAPI.io
Class DataRaster

java.lang.Object
  extended by hydroScalingAPI.io.DataRaster

public class DataRaster
extends java.lang.Object

Uses the information on a MetaRaster to read one of the binary files associated to it. Methods contained in this class return data in different formats (Byte, Integer, Float or Double) and in different arrangements (matrix or vector).

Author:
Ricardo Mantilla

Constructor Summary
DataRaster(MetaRaster metaInfo)
          Creates a DataRaster object that will read files associated with the metaRaster file given as a parameter.
 
Method Summary
 byte[][] getByte()
          Casts data into Byte Format and returns a Matrix.
 double[][] getDouble()
          Casts data into Double Format and returns a Matrix.
 double getDouble(int i, int j)
          Reads one value from the File.
 float getEqualized(float f)
          Maps a number into the [0,1] according to the cumulative distribution function.
 float[][] getFloat()
          Casts data into Float Format and returns a Matrix.
 float[][] getFloatEqualized()
          Casts data into Float Format and returns a matrix (Array[n][m]).
 float[][] getFloatLine()
          Casts data into Float Format and returns a single column Vector.
 float[][] getFloatLineEqualized()
          Casts data into Float Format and returns a single column Vector.
 float[][] getFloatLineEqualized(float[] CDF)
          Casts data into Float Format and returns a matrix (Array[n][m]).
 float[][] getFloatLineEqualizedResampled(int factor)
          Casts data into Float Format and returns a single column Vector.
 float[][] getFloatLineResampled(int factor)
          Casts data into Float Format and returns a matrix (Array[n][m]).
 float[][] getFloatResampled(int factor)
          Casts data into Float Format and returns a Matrix.
 int[][] getInt()
          Casts data into Integer Format and returns a Matrix.
static void main(java.lang.String[] args)
          A few tests of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataRaster

public DataRaster(MetaRaster metaInfo)
           throws java.io.IOException
Creates a DataRaster object that will read files associated with the metaRaster file given as a parameter.

Parameters:
metaInfo - The MetaRaster with information about the binary file to be read.
Throws:
java.io.IOException - Captures problems while reading the binary file
Method Detail

getByte

public byte[][] getByte()
Casts data into Byte Format and returns a Matrix.

Returns:
Returns an Matrix (Array[n][m]) of Bytes.

getInt

public int[][] getInt()
Casts data into Integer Format and returns a Matrix.

Returns:
Returns an Matrix (Array[n][m]) of Integers.

getFloat

public float[][] getFloat()
Casts data into Float Format and returns a Matrix.

Returns:
Returns an Matrix (Array[n][m]) of Floats.

getFloatResampled

public float[][] getFloatResampled(int factor)
Casts data into Float Format and returns a Matrix.

Returns:
Returns an Matrix (Array[n][m]) of Floats.

getFloatLine

public float[][] getFloatLine()
Casts data into Float Format and returns a single column Vector. This is arrangement is usefull for Visad Flatfields.

Returns:
Returns an single column Vector (Array[1][n*m]) of Floats.

getFloatLineEqualized

public float[][] getFloatLineEqualized()
Casts data into Float Format and returns a single column Vector. In addition data is mapped in the range [0,1] using the cumulative probability distribution function. This arrangement is useful for Visad Flatfields and is used to create a coloring scheeme that better represents data variability.

Returns:
Returns an single column Vector (Array[1][n*m]) of histogram equalized Floats.

getFloatLineResampled

public float[][] getFloatLineResampled(int factor)
Casts data into Float Format and returns a matrix (Array[n][m]). In addition data is mapped in the range [0,1] using the cumulative probability distribution function. This arrangement is useful for Visad Flatfields and is used to create a coloring scheeme that better represents data variability.

Returns:
Returns an single column Vector (Array[1][n*m]) of histogram equalized Floats.

getFloatLineEqualizedResampled

public float[][] getFloatLineEqualizedResampled(int factor)
Casts data into Float Format and returns a single column Vector. In addition data is mapped in the range [0,1] using the cumulative probability distribution function. This arrangement is useful for Visad Flatfields and is used to create a coloring scheeme that better represents data variability.

Returns:
Returns an single column Vector (Array[1][n*m]) of histogram equalized Floats.

getFloatEqualized

public float[][] getFloatEqualized()
Casts data into Float Format and returns a matrix (Array[n][m]). In addition data is mapped in the range [0,1] using the cumulative probability distribution function. This arrangement is useful for Visad Flatfields and is used to create a coloring scheeme that better represents data variability.

Returns:
Returns an single column Vector (Array[1][n*m]) of histogram equalized Floats.

getEqualized

public float getEqualized(float f)
Maps a number into the [0,1] according to the cumulative distribution function.

Parameters:
f - The value to be transformed
Returns:
a Float in the interval (0,1)

getFloatLineEqualized

public float[][] getFloatLineEqualized(float[] CDF)
Casts data into Float Format and returns a matrix (Array[n][m]). In addition data is mapped in the range [0,1] using a predetrmined cumulative probability distribution function. This arrangement is useful for Visad Flatfields and is used to create a coloring scheeme that better represents data variability.

Parameters:
CDF - The Cumulative Distristribution Function to be used.
Returns:
Returns an single column Vector (Array[1][n*m]) of histogram equalized Floats.

getDouble

public double[][] getDouble()
Casts data into Double Format and returns a Matrix.

Returns:
Returns an Matrix (Array[n][m]) of Floats.

getDouble

public double getDouble(int i,
                        int j)
Reads one value from the File.

Returns:
Returns the read value in double format.

main

public static void main(java.lang.String[] args)
A few tests of this class.

Parameters:
args - Arguments are ignored.


CUENCAS was initially developed by Ricardo Mantilla at the University of Colorado under the supervision of Dr. Vijay K. Gupta. We wish to recognize the support from the National Science Fundation.