hydroScalingAPI.util.geomorphology.objects
Class Basin

java.lang.Object
  extended by hydroScalingAPI.util.geomorphology.objects.Basin

public class Basin
extends java.lang.Object

Uses a recursive algorithm to find the locations in the DEM that drain through a given point in the landscape, and defines the boundary of these group of points. This class implements several methods for analysis of characteristics in the basin

Author:
Ricardo Mantilla

Constructor Summary
Basin(int x, int y, byte[][] fullDirMatrix, MetaRaster mr)
          Creates an instance of Basin
 
Method Summary
 visad.Gridded2DSet getBasinDivide()
          Creates visad.Gridded2DSet with the basin divide polygon
 byte[][] getBasinMask()
          Returns and array of the same size of the DEM with 1s in the positions that belong to the basin
 float[] getDivideShapeFactor()
          Uses the basin divide to determine a shape factor for the basin.
 float[] getElevations()
          Reads the corrected DEM and returns the elevations of the points contained in the basin
 int[][] getEncapsulatedHillslopesMask(byte[][] matDir, RSNDecomposition myRSNAnalysis, int level)
          Returns and array of the same size of the DEM with and ID in the positions that belong to the basin.
 byte[][] getEncapsulatedNetworkMask()
          Returns and array of the same size of the DEM with 1s in the positions that are network and belong to the basin
 java.util.Hashtable getHypCurve()
          Computes the hypsometric curve and some statistical parameters: area, mean, standard deviation, skewness, and kurtosis.
 float[][] getLonLatBasin()
          Returns an array of floats float[2][numPointsInBasin] with the longitudes (float[0]) and latitudes (float[1]) for the points that belong to the basin
 float[][] getLonLatBasinDivide()
          Returns an array of floats float[2][numPointsInDivide] with the longitudes (float[0]) and latitudes (float[1]) for the points that determine the divide
 int getMaxX()
          The maximum column of a box encosing the basin
 int getMaxY()
          The maximum row of a box encosing the basin
 float getMaxZ()
          Returns the elevation of the highest point in the basin
 int getMinX()
          The minimum column of a box encosing the basin
 int getMinY()
          The minimum row of a box encosing the basin
 float getMinZ()
          Returns the elevation of the lowest point in the basin
 int getOutletID()
          Returns the ID of the basin outlet
 visad.RealTuple getOutletTuple()
          Returns an visad object that describes the basin outlet
 float getRelief()
          Returns the difference between the highest and the lowest points in the basin
 int[][] getXYBasin()
          Returns an array of integers int[2][numPointsInBasin] with the column number (int[0]) and the row number (int[1]) for the points that belong to the basin
 int[][] getXYBasinDivide()
          Returns an array of integers int[2][numPointsInDivide] with the column number (int[0]) and the row number (int[1]) for the points that determine the divide
static void main(java.lang.String[] args)
          Tests for the class
 void setXYBasin(int[][] newXY)
          Returns an array of integers int[2][numPointsInBasin] with the column number (int[0]) and the row number (int[1]) for the points that belong to the basin
 java.lang.String toString()
          Prints a description of the Basin with respect to its location in the DEM
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Basin

public Basin(int x,
             int y,
             byte[][] fullDirMatrix,
             MetaRaster mr)
Creates an instance of Basin

Parameters:
x - The column number of the basin outlet
y - The row number of the basin outlet
fullDirMatrix - The direction matrix associated to the DEM where the basin is ebedded
mr - The MetaRaster that describes the DEM
Method Detail

toString

public java.lang.String toString()
Prints a description of the Basin with respect to its location in the DEM

Overrides:
toString in class java.lang.Object
Returns:
A String

getLonLatBasin

public float[][] getLonLatBasin()
Returns an array of floats float[2][numPointsInBasin] with the longitudes (float[0]) and latitudes (float[1]) for the points that belong to the basin

Returns:
An array with the coordinates of the points in the landscape that belong to the basin

getXYBasin

public int[][] getXYBasin()
Returns an array of integers int[2][numPointsInBasin] with the column number (int[0]) and the row number (int[1]) for the points that belong to the basin

Returns:
An array of i,j position of points that belong to the basin

setXYBasin

public void setXYBasin(int[][] newXY)
Returns an array of integers int[2][numPointsInBasin] with the column number (int[0]) and the row number (int[1]) for the points that belong to the basin


getBasinDivide

public visad.Gridded2DSet getBasinDivide()
                                  throws visad.VisADException
Creates visad.Gridded2DSet with the basin divide polygon

Returns:
A visad.Gridded2DSet
Throws:
visad.VisADException - Captures errors while creating the visad object

getDivideShapeFactor

public float[] getDivideShapeFactor()
Uses the basin divide to determine a shape factor for the basin. Shape factor equals the ratio between the basin diameter and the basin width

Returns:
An int[3] array where int[0] is the shape factor, int[1] is the basin diameter and int[2] is the basin width perpendicular to the diameter line

getXYBasinDivide

public int[][] getXYBasinDivide()
Returns an array of integers int[2][numPointsInDivide] with the column number (int[0]) and the row number (int[1]) for the points that determine the divide

Returns:
An int[][] array

getLonLatBasinDivide

public float[][] getLonLatBasinDivide()
Returns an array of floats float[2][numPointsInDivide] with the longitudes (float[0]) and latitudes (float[1]) for the points that determine the divide

Returns:
A float[][] array

getOutletTuple

public visad.RealTuple getOutletTuple()
                               throws visad.VisADException,
                                      java.rmi.RemoteException
Returns an visad object that describes the basin outlet

Returns:
A visad.RealTuple of the basin outlet
Throws:
java.rmi.RemoteException - Captures errors while assigning values to VisAD data objects
visad.VisADException - Captures errors while creating VisAD objects

getMinX

public int getMinX()
The minimum column of a box encosing the basin

Returns:
The column index

getMaxX

public int getMaxX()
The maximum column of a box encosing the basin

Returns:
The column index

getMinY

public int getMinY()
The minimum row of a box encosing the basin

Returns:
The column index

getMaxY

public int getMaxY()
The maximum row of a box encosing the basin

Returns:
The column index

getElevations

public float[] getElevations()
                      throws java.io.IOException
Reads the corrected DEM and returns the elevations of the points contained in the basin

Returns:
A float[] with the elevations of the points
Throws:
java.io.IOException - Captures errors while reading from the DEM

getRelief

public float getRelief()
                throws java.io.IOException
Returns the difference between the highest and the lowest points in the basin

Returns:
The basin relief
Throws:
java.io.IOException - Captures errors while reading from the DEM

getMaxZ

public float getMaxZ()
              throws java.io.IOException
Returns the elevation of the highest point in the basin

Returns:
The highest point
Throws:
java.io.IOException - Captures errors while reading from the DEM

getMinZ

public float getMinZ()
              throws java.io.IOException
Returns the elevation of the lowest point in the basin

Returns:
The lowest point
Throws:
java.io.IOException - Captures errors while reading from the DEM

getOutletID

public int getOutletID()
Returns the ID of the basin outlet

Returns:
An integer with the basin ID

getBasinMask

public byte[][] getBasinMask()
Returns and array of the same size of the DEM with 1s in the positions that belong to the basin

Returns:
A byte[][] with the basin mask

getEncapsulatedNetworkMask

public byte[][] getEncapsulatedNetworkMask()
Returns and array of the same size of the DEM with 1s in the positions that are network and belong to the basin

Returns:
A byte[][] with the basin network mask

getEncapsulatedHillslopesMask

public int[][] getEncapsulatedHillslopesMask(byte[][] matDir,
                                             RSNDecomposition myRSNAnalysis,
                                             int level)
Returns and array of the same size of the DEM with and ID in the positions that belong to the basin. Points with the same ID correspond to a unique pseudo-hillslope at the level Omega

Parameters:
myRSNAnalysis -
level -
Returns:
A byte[][] with the basin network mask

getHypCurve

public java.util.Hashtable getHypCurve()
                                throws java.io.IOException
Computes the hypsometric curve and some statistical parameters: area, mean, standard deviation, skewness, and kurtosis.

Returns:
Vector object with: a/A, h/H, mean, sd, kurtosis, skewness
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Tests for the class

Parameters:
args - The command line arguments


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.