LSDTopoTools
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Protected Attributes | List of all members
LSDIndexChannelTree Class Reference

This object spawns vectors of LSDIndexChannels. More...

#include <LSDIndexChannelTree.hpp>

Public Member Functions

 LSDIndexChannelTree (LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChannelNetwork, int starting_junction)
 Create an LSDIndexChannelTree object from a starting junction. More...
 
 LSDIndexChannelTree (LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChannelNetwork, int starting_junction, int org_switch, LSDRaster &DistanceFromOutlet)
 Create an LSDIndexChannelTree object from a starting junction and orginisation switch. More...
 
 LSDIndexChannelTree (LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChannelNetwork, int starting_junction, int org_switch, LSDRaster &DistanceFromOutlet, int pruning_switch, float pruning_threshold)
 Create an LSDIndexChannelTree object from a starting junction, orginisation switch and pruning parameters. More...
 
vector< LSDIndexChannelget_LSDIndexChannelVector ()
 
vector< vector< float > > calculate_chi_from_channel_tree (LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChannelNetwork, float m_over_n, float A_0)
 This function calcualtes the chi value starting from the bottom node of the channel tree and working its way up. More...
 
void print_chi_vs_elevation_from_channel_tree (LSDRaster &Elevation, LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChannelNetwork, float m_over_n, float A_0, string chi_vs_elev_fname)
 This function prints chi values. More...
 
float fit_m_over_n_mainstem (vector< float > &m_over_n_values, vector< float > &R_squared, float A_0, LSDFlowInfo &FlowInfo, LSDRaster &Elevation_Raster, float start_movn, float increment_movn, int n_movn)
 This calculates the best fit m over n on the main stem channel. More...
 
LSDIndexRaster TributaryArray_to_LSDIndexRaster ()
 This function takes the channel tree and prints it to an LSDIndexRaster. More...
 
vector< LSDChannelretrieve_LSDChannels_from_tree (float m_over_n, float A_0, LSDFlowInfo &FlowInfo, LSDRaster &Elevation_Raster)
 This creates a vector of LSDChannels, they contain area and chi information. More...
 
float search_for_best_fit_m_over_n (float A_0, int n_movern, float d_movern, float start_movern, int minimum_segment_length, float sigma, int target_nodes, LSDFlowInfo &FlowInfo, LSDRaster &Elevation_Raster, string fname)
 This function uses the segment fitting tool to look for the best fit values of m over n. More...
 
void print_LSDChannels_from_tree (float m_over_n, float A_0, LSDFlowInfo &FlowInfo, LSDRaster &Elevation_Raster, LSDRaster &FlowDistance, string fname)
 This prints a file that contiains all the channel information. It can be used to plot and analyze the channel profiles. More...
 
void print_LSDChannels_for_chi_network_ingestion (LSDFlowInfo &FlowInfo, LSDRaster &Elevation_Raster, LSDRaster &FlowDistance, string fname)
 This prints all the channels for ingestion into the chi analysis object. More...
 
void print_LSDChannels_for_chi_network_ingestion (LSDFlowInfo &FlowInfo, LSDRaster &Elevation_Raster, LSDRaster &FlowDistance, string fname, LSDRaster &Discharge)
 This prints all the channels for ingestion into the chi analysis object. THIS VERSION USES DISCHARGE INSTEAD OF DRAINAGE AREA (that is, you can put in a nonuniforms precipitaiton field). More...
 
void convert_chan_file_for_ArcMap_ingestion (string fname, LSDRaster &DrainageArea, LSDRaster &Discharge)
 This takes a .chan file and converts it into a comma seperated file with headers that can be read into ArcMap easily Includes the discharge. More...
 
void convert_chan_file_for_ArcMap_ingestion (string fname)
 This takes a .chan file and converts it into a comma seperated file with headers that can be read into ArcMap easily. More...
 
int get_NRows () const
 
int get_NCols () const
 
float get_XMinimum () const
 
float get_YMinimum () const
 
float get_DataResolution () const
 
int get_NoDataValue () const
 

Protected Attributes

int NRows
 Number of rows. More...
 
int NCols
 Number of columns.
 
float XMinimum
 Minimum X coordinate.
 
float YMinimum
 Minimum Y coordinate.
 
float DataResolution
 Data resolution.
 
int NoDataValue
 No data value.
 
int outlet_junction
 Outlet Junction.
 
int outlet_node
 Outlet node.
 
int organization_switch
 There are a number of ways to organize this data and this switch tells the object how its data are organized. More...
 
vector< int > upstream_junction_list
 Vector of upstream junctions.
 
vector< LSDIndexChannelIndexChannelVector
 A vector containing all the index channel nodes.
 
vector< int > receiver_channel
 Vector of reciever channels.
 
vector< int > node_on_receiver_channel
 Vector of nodes along reciever channel.
 

Detailed Description

This object spawns vectors of LSDIndexChannels.

Constructor & Destructor Documentation

LSDIndexChannelTree::LSDIndexChannelTree ( LSDFlowInfo FlowInfo,
LSDJunctionNetwork ChannelNetwork,
int  starting_junction 
)
inline

Create an LSDIndexChannelTree object from a starting junction.

Parameters
FlowInfoLSDFlowInfo object.
ChannelNetworkLSDJunctionNetwork object.
starting_junctionStarting junction.
Author
SMM
Date
01/09/12
LSDIndexChannelTree::LSDIndexChannelTree ( LSDFlowInfo FlowInfo,
LSDJunctionNetwork ChannelNetwork,
int  starting_junction,
int  org_switch,
LSDRaster DistanceFromOutlet 
)
inline

Create an LSDIndexChannelTree object from a starting junction and orginisation switch.

If organization switch is 0, the tree is organized based on the LSDJunctionNetwork object that is, it is made up of links organized based on the Fastscape algorithm If org_switch is 1, then the channel network is based on a main stem channel with tributaries that only flow into the main stem.

Parameters
FlowInfoLSDFlowInfo object.
ChannelNetworkLSDJunctionNetwork object.
starting_junctionStarting junction.
org_switchOrganization switch.
DistanceFromOutletLSDRaster of distances from the outlet.
Author
SMM
Date
01/09/12
LSDIndexChannelTree::LSDIndexChannelTree ( LSDFlowInfo FlowInfo,
LSDJunctionNetwork ChannelNetwork,
int  starting_junction,
int  org_switch,
LSDRaster DistanceFromOutlet,
int  pruning_switch,
float  pruning_threshold 
)
inline

Create an LSDIndexChannelTree object from a starting junction, orginisation switch and pruning parameters.

If organization switch is 0, the tree is organized based on the LSDJunctionNetwork object that is, it is made up of links organized based on the Fastscape algorithm If org_switch is 1, then the channel network is based on a main stem channel with tributaries that only flow into the main stem The pruning switch is based on: pruning_switch == 0 channels are only added if they exceed a threshold drainage area
pruning_switch == 1 channels are only added if the ratio between them and the mainstem exceeds a certain value (pruning_threshold)
pruning_switch == 2 channels are only added if the ratio between them and the area of the mainstem at the junction exceeds a certain value

Parameters
FlowInfoLSDFlowInfo object.
ChannelNetworkLSDJunctionNetwork object.
starting_junctionStarting junction.
org_switchOrganization switch.
DistanceFromOutletLSDRaster of distances from the outlet.
pruning_switchPruning switch.
pruning_thresholdPruning threshold.
Author
SMM
Date
01/09/12

Member Function Documentation

vector< vector< float > > LSDIndexChannelTree::calculate_chi_from_channel_tree ( LSDFlowInfo FlowInfo,
LSDJunctionNetwork ChannelNetwork,
float  m_over_n,
float  A_0 
)

This function calcualtes the chi value starting from the bottom node of the channel tree and working its way up.

Note that junctions are the top of the channel.

Parameters
FlowInfoLSDFlowInfo object.
ChannelNetworkLSDJunctionNetwork object.
m_over_nVector of m over n values.
A_0A_0 value.
Returns
Vector of chi values.
Author
SMM
Date
01/09/12
void LSDIndexChannelTree::convert_chan_file_for_ArcMap_ingestion ( string  fname,
LSDRaster DrainageArea,
LSDRaster Discharge 
)

This takes a .chan file and converts it into a comma seperated file with headers that can be read into ArcMap easily Includes the discharge.

Parameters
fnamethe filename of the channel file. The function spits out a similarly named outfile
drainageareaa raster of the drainage area, assumed to be m^2
Dischargea raster of the discharge, assumed to be in m^3/yr
Author
SMM
Date
07/05/2015
void LSDIndexChannelTree::convert_chan_file_for_ArcMap_ingestion ( string  fname)

This takes a .chan file and converts it into a comma seperated file with headers that can be read into ArcMap easily.

Parameters
fnamethe filename of the channel file. The function spits out a similarly named outfile
Author
SMM
Date
22/11/2013
float LSDIndexChannelTree::fit_m_over_n_mainstem ( vector< float > &  m_over_n_values,
vector< float > &  R_squared,
float  A_0,
LSDFlowInfo FlowInfo,
LSDRaster Elevation_Raster,
float  start_movn,
float  increment_movn,
int  n_movn 
)

This calculates the best fit m over n on the main stem channel.

Minimizes the R^2 of the main stem channel assuming it is in steady state that is assuming the entire main stem is undergoing the same uplift.

Parameters
m_over_n_valuesVector of m over n values.
R_squaredVector of R-Squared values.
A_0A_0 value.
FlowInfoLSDFlowInfo object.
Elevation_RasterLSDRaster of elevation.
start_movn
increment_movn
n_movn
Returns
Best fit m over n.
Author
SMM
Date
01/09/12
float LSDIndexChannelTree::get_DataResolution ( ) const
inline
Returns
Data resolution as an integer.
vector< LSDIndexChannel > LSDIndexChannelTree::get_LSDIndexChannelVector ( )
inline
Returns
Vector of index channels.
Author
SMM
Date
01/09/12
int LSDIndexChannelTree::get_NCols ( ) const
inline
Returns
Number of columns as an integer.
int LSDIndexChannelTree::get_NoDataValue ( ) const
inline
Returns
No Data Value as an integer.
int LSDIndexChannelTree::get_NRows ( ) const
inline
Returns
Number of rows as an integer.
float LSDIndexChannelTree::get_XMinimum ( ) const
inline
Returns
Minimum X coordinate as an integer.
float LSDIndexChannelTree::get_YMinimum ( ) const
inline
Returns
Minimum Y coordinate as an integer.
void LSDIndexChannelTree::print_chi_vs_elevation_from_channel_tree ( LSDRaster Elevation,
LSDFlowInfo FlowInfo,
LSDJunctionNetwork ChannelNetwork,
float  m_over_n,
float  A_0,
string  chi_vs_elev_fname 
)

This function prints chi values.

It is used on the channel tree when channels are organized by links.

Parameters
ElevationLSDRaster of elevation.
FlowInfoLSDFlowInfo object.
ChannelNetworkLSDJunctionNetwork object.
m_over_nVector of m over n values.
A_0A_0 value.
chi_vs_elev_fnameOutput filename.
Author
SMM
Date
01/09/12
void LSDIndexChannelTree::print_LSDChannels_for_chi_network_ingestion ( LSDFlowInfo FlowInfo,
LSDRaster Elevation_Raster,
LSDRaster FlowDistance,
string  fname 
)

This prints all the channels for ingestion into the chi analysis object.

Data extracted form this file can be used in a standalone chi analysis function. The file format is: channel_number node_index row column flow_dist chi elevation drainage_area.

Parameters
FlowInfoLSDFlowInfo object.
Elevation_RasterLSDRaster of elevation.
FlowDistanceLSDRaster of flow length.
fnameOutput filename.
Author
SMM
Date
01/05/13
void LSDIndexChannelTree::print_LSDChannels_for_chi_network_ingestion ( LSDFlowInfo FlowInfo,
LSDRaster Elevation_Raster,
LSDRaster FlowDistance,
string  fname,
LSDRaster Discharge 
)

This prints all the channels for ingestion into the chi analysis object. THIS VERSION USES DISCHARGE INSTEAD OF DRAINAGE AREA (that is, you can put in a nonuniforms precipitaiton field).

Data extracted form this file can be used in a standalone chi analysis function. The file format is: channel_number node_index row column flow_dist chi elevation discharge.

Parameters
FlowInfoLSDFlowInfo object.
Elevation_RasterLSDRaster of elevation.
FlowDistanceLSDRaster of flow length.
fnameOutput filename.
DischargeThe discharge raster. Can be calculated using the LSDFlowInfo upslope_variable_accumulator function
Author
SMM
Date
07/05/15
void LSDIndexChannelTree::print_LSDChannels_from_tree ( float  m_over_n,
float  A_0,
LSDFlowInfo FlowInfo,
LSDRaster Elevation_Raster,
LSDRaster FlowDistance,
string  fname 
)

This prints a file that contiains all the channel information. It can be used to plot and analyze the channel profiles.

The file format is: channel_number node_index row column flow_dist chi elevation drainage_area.

Parameters
m_over_nm over n ratio.
A_0A_0 value.
FlowInfoLSDFlowInfo object.
Elevation_RasterLSDRaster of elevation.
FlowDistanceLSDRaster of flow length.
fnameOutput filename.
Author
SMM
Date
01/09/12
vector< LSDChannel > LSDIndexChannelTree::retrieve_LSDChannels_from_tree ( float  m_over_n,
float  A_0,
LSDFlowInfo FlowInfo,
LSDRaster Elevation_Raster 
)

This creates a vector of LSDChannels, they contain area and chi information.

Parameters
m_over_nm over n ratio.
A_0A_0 value.
FlowInfoLSDFlowInfo object.
Elevation_RasterLSDRaster of elevation.
Returns
Vector of LSDChannels.
Author
SMM
Date
01/09/12
float LSDIndexChannelTree::search_for_best_fit_m_over_n ( float  A_0,
int  n_movern,
float  d_movern,
float  start_movern,
int  minimum_segment_length,
float  sigma,
int  target_nodes,
LSDFlowInfo FlowInfo,
LSDRaster Elevation_Raster,
string  fname 
)

This function uses the segment fitting tool to look for the best fit values of m over n.

Parameters
A_0A_0 value.
n_movern
d_movern
start_movern
minimum_segment_length
sigmaSigma value.
target_nodes
FlowInfoLSDFlowInfo object.
Elevation_RasterLSDRaster of elevation.
fnameOutput filename.
Returns
Best fit m over n ratio.
Author
SMM
Date
01/05/13
LSDIndexRaster LSDIndexChannelTree::TributaryArray_to_LSDIndexRaster ( )

This function takes the channel tree and prints it to an LSDIndexRaster.

Returns
LSDIndexRaster of the channel tree.
Author
SMM
Date
01/09/12

Member Data Documentation

int LSDIndexChannelTree::NRows
protected

Number of rows.

Returns
Raster values as a 2D Array.
int LSDIndexChannelTree::organization_switch
protected

There are a number of ways to organize this data and this switch tells the object how its data are organized.

It will reject member function operations if the data type is incorrect.


The documentation for this class was generated from the following files: