hydroScalingAPI.util.geomorphology.objects
Class HortonAnalysis

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

public class HortonAnalysis
extends java.lang.Object

This class organizes network related information in the context of the Horton-Strahler order scheme

Author:
Ricardo Mantilla

Field Summary
 int[][] contactsArray
          An array conaining the pixel ID before the stream merges with another stream for streams of different order.
 int[][] headsArray
          An array conaining the pixel ID where the stream begins for streams of different order.
 int[][] tailsArray
          An array conaining the pixel ID where the stream merges with another stream (junction) for streams of different order.
 
Constructor Summary
HortonAnalysis(Basin bas, MetaRaster metar, byte[][] DM)
          Creates new HortonAnalysis
 
Method Summary
 float[] ajustesRO(float[] datos, int minOrderToInclude, int maxOrderToInclude, boolean takeLogs)
          Calculates the regression parameters of a Horton plot
 int getBasinOrder()
          The network order
 float[] getBranchingPerOrder()
          This method retunrns the numbers of branches of order omega
 float[] getBranchingRatio(int minOrderToInclude, int maxOrderToInclude)
          Calculates the branching ratio
 float[] getBranchingRatio(int minOrderToInclude, int maxOrderToInclude, float[] cuentaOrdenes)
          Calculates the branching ratio
 float[][] getLengthDistributionPerOrder(int metric)
          Calculates an array with the values of stream lengths for complete Horton streams.
 float[] getLengthPerOrder(float[][] lengthArray)
          Calculates an array with the average values of channel lengths for complete Horton streams.
 float[] getLengthPerOrder(int metric)
          Calculates an array with the average values of channel lengths for complete Horton streams.
 float[] getLengthRatio(int minOrderToInclude, int maxOrderToInclude, float[][] lengthArray)
          Calculates the length ratio given by an array
 float[] getLengthRatio(int minOrderToInclude, int maxOrderToInclude, int metric)
          Calculates the geometric or topologic length ratio
 float[][] getQuantityDistributionPerOrder(int varToGet)
          Calculates an array with the values of a quantity for complete Horton streams.
 float[] getQuantityPerOrder(float[][] quantityArray)
          Calculates an array with the average values of a quantity for complete Horton streams given as an array.
 float[] getQuantityPerOrder(int varToGet)
          Calculates an array with the average values of a quantity for complete Horton streams.
 float[] getQuantityRatio(int minOrderToInclude, int maxOrderToInclude, float[][] quantityArray)
          Calculates the Horton ratio for the designated quantity given by an array.
 float[] getQuantityRatio(int minOrderToInclude, int maxOrderToInclude, int varToGet)
          Calculates the Horton ratio for the designated quantity.
static void main(java.lang.String[] args)
          Tests for the class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headsArray

public int[][] headsArray
An array conaining the pixel ID where the stream begins for streams of different order. The first dimension of the array corresponds to the order of the streams and the second dimesion contains the IDs. ID=i+j*numCols, where i is the column number of the pixel and j is the row number of the pixel


contactsArray

public int[][] contactsArray
An array conaining the pixel ID before the stream merges with another stream for streams of different order. The first dimension of the array corresponds to the order of the streams and the second dimesion contains the IDs. ID=i+j*numCols, where i is the column number of the pixel and j is the row number of the pixel


tailsArray

public int[][] tailsArray
An array conaining the pixel ID where the stream merges with another stream (junction) for streams of different order. The first dimension of the array corresponds to the order of the streams and the second dimesion contains the IDs. ID=i+j*numCols, where i is the column number of the pixel and j is the row number of the pixel

Constructor Detail

HortonAnalysis

public HortonAnalysis(Basin bas,
                      MetaRaster metar,
                      byte[][] DM)
               throws java.io.IOException
Creates new HortonAnalysis

Parameters:
bas - The Basin on which the analysis is performed
metar - The MetaRaster describing the DEM that contains the basin
DM - The direction matrix
Throws:
java.io.IOException - Captures errors while readin the vectorial network files
Method Detail

getBranchingRatio

public float[] getBranchingRatio(int minOrderToInclude,
                                 int maxOrderToInclude,
                                 float[] cuentaOrdenes)
Calculates the branching ratio

Parameters:
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
cuentaOrdenes - An array with the number of brances of different orders
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2

getBranchingRatio

public float[] getBranchingRatio(int minOrderToInclude,
                                 int maxOrderToInclude)
Calculates the branching ratio

Parameters:
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2

getBranchingPerOrder

public float[] getBranchingPerOrder()
This method retunrns the numbers of branches of order omega

Returns:
An array of integers

getQuantityRatio

public float[] getQuantityRatio(int minOrderToInclude,
                                int maxOrderToInclude,
                                int varToGet)
                         throws java.io.IOException
Calculates the Horton ratio for the designated quantity. Available quantities are:

0: Upstream Areas

1: Magnitudes

2: Longest channel length

3: Topologic diameter

4: Total channels lenght

5: Link's outlet slope

6: Total channel drop

7: Maximum channel drop

8: Channel elevation

Parameters:
varToGet - The variable to get
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2
Throws:
java.io.IOException - Captures errors while reading the values

getQuantityRatio

public float[] getQuantityRatio(int minOrderToInclude,
                                int maxOrderToInclude,
                                float[][] quantityArray)
                         throws java.io.IOException
Calculates the Horton ratio for the designated quantity given by an array.

Parameters:
quantityArray - The array containing the variable values
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2
Throws:
java.io.IOException - Captures errors while reading the values

getQuantityPerOrder

public float[] getQuantityPerOrder(int varToGet)
                            throws java.io.IOException
Calculates an array with the average values of a quantity for complete Horton streams. Available quantities are:

0: Upstream Areas

1: Magnitudes

2: Longest channel length

3: Topologic diameter

4: Total channels lenght

5: Link's outlet slope

6: Total channel drop

7: Maximum channel drop

8: Channel elevation

Parameters:
varToGet - The variable to get
Returns:
An array with the average values
Throws:
java.io.IOException - Captures errors while reading the values

getQuantityPerOrder

public float[] getQuantityPerOrder(float[][] quantityArray)
                            throws java.io.IOException
Calculates an array with the average values of a quantity for complete Horton streams given as an array.

Parameters:
quantityArray - The array containing the variable values
Returns:
An array with the average values
Throws:
java.io.IOException - Captures errors while reading the values

getQuantityDistributionPerOrder

public float[][] getQuantityDistributionPerOrder(int varToGet)
                                          throws java.io.IOException
Calculates an array with the values of a quantity for complete Horton streams. Available quantities are:

0: Upstream Areas

1: Magnitudes

2: Longest channel length

3: Topologic diameter

4: Total channels lenght

5: Link's outlet slope

6: Total channel drop

7: Maximum channel drop

8: Channel elevation

9: Geometric Channel Length/p>

10: Topologic Channel Length

Parameters:
varToGet - The variable to get
Returns:
A float[maxOrder][numStreamsOmega] with the values
Throws:
java.io.IOException - Captures errors while reading the values

getLengthRatio

public float[] getLengthRatio(int minOrderToInclude,
                              int maxOrderToInclude,
                              int metric)
                       throws java.io.IOException
Calculates the geometric or topologic length ratio

Parameters:
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
metric - The metric to use 0: geometric, 1: Topologic.
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2
Throws:
java.io.IOException - Captures errors while reading the values

getLengthRatio

public float[] getLengthRatio(int minOrderToInclude,
                              int maxOrderToInclude,
                              float[][] lengthArray)
                       throws java.io.IOException
Calculates the length ratio given by an array

Parameters:
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
lengthArray - The array with lengths
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2
Throws:
java.io.IOException - Captures errors while reading the values

getLengthPerOrder

public float[] getLengthPerOrder(int metric)
                          throws java.io.IOException
Calculates an array with the average values of channel lengths for complete Horton streams.

Parameters:
metric - The metric to use 0: geometric, 1: Topologic.
Returns:
An array with the average values
Throws:
java.io.IOException - Captures errors while reading the values

getLengthPerOrder

public float[] getLengthPerOrder(float[][] lengthArray)
                          throws java.io.IOException
Calculates an array with the average values of channel lengths for complete Horton streams.

Parameters:
lengthArray - The array containing the lengths
Returns:
An array with the average values
Throws:
java.io.IOException - Captures errors while reading the values

getLengthDistributionPerOrder

public float[][] getLengthDistributionPerOrder(int metric)
Calculates an array with the values of stream lengths for complete Horton streams.

Parameters:
metric - The metric to use 0: geometric, 1: Topologic.
Returns:
A float[maxOrder][numStreamsOmega] with the values

ajustesRO

public float[] ajustesRO(float[] datos,
                         int minOrderToInclude,
                         int maxOrderToInclude,
                         boolean takeLogs)
Calculates the regression parameters of a Horton plot

Parameters:
datos - The data to analyze
minOrderToInclude - The minimum order to include in the regression
maxOrderToInclude - The maximum order to include in the regression
takeLogs - A boolean flag indicating if logs of the variable need to be taken
Returns:
An int[] with int[0]=The regression slope, int[1]=The regression intercept, and int[2]=the regression's R^2

getBasinOrder

public int getBasinOrder()
The network order

Returns:
The basin Horton-Strahler order

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.