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< LSDIndexChannel > | get_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< LSDChannel > | 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. 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< LSDIndexChannel > | IndexChannelVector |
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. | |
This object spawns vectors of LSDIndexChannels.
|
inline |
Create an LSDIndexChannelTree object from a starting junction.
FlowInfo | LSDFlowInfo object. |
ChannelNetwork | LSDJunctionNetwork object. |
starting_junction | Starting junction. |
|
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.
FlowInfo | LSDFlowInfo object. |
ChannelNetwork | LSDJunctionNetwork object. |
starting_junction | Starting junction. |
org_switch | Organization switch. |
DistanceFromOutlet | LSDRaster of distances from the outlet. |
|
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
FlowInfo | LSDFlowInfo object. |
ChannelNetwork | LSDJunctionNetwork object. |
starting_junction | Starting junction. |
org_switch | Organization switch. |
DistanceFromOutlet | LSDRaster of distances from the outlet. |
pruning_switch | Pruning switch. |
pruning_threshold | Pruning threshold. |
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.
FlowInfo | LSDFlowInfo object. |
ChannelNetwork | LSDJunctionNetwork object. |
m_over_n | Vector of m over n values. |
A_0 | A_0 value. |
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.
fname | the filename of the channel file. The function spits out a similarly named outfile |
drainagearea | a raster of the drainage area, assumed to be m^2 |
Discharge | a raster of the discharge, assumed to be in m^3/yr |
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.
fname | the filename of the channel file. The function spits out a similarly named outfile |
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.
m_over_n_values | Vector of m over n values. |
R_squared | Vector of R-Squared values. |
A_0 | A_0 value. |
FlowInfo | LSDFlowInfo object. |
Elevation_Raster | LSDRaster of elevation. |
start_movn | |
increment_movn | |
n_movn |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
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.
Elevation | LSDRaster of elevation. |
FlowInfo | LSDFlowInfo object. |
ChannelNetwork | LSDJunctionNetwork object. |
m_over_n | Vector of m over n values. |
A_0 | A_0 value. |
chi_vs_elev_fname | Output filename. |
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.
FlowInfo | LSDFlowInfo object. |
Elevation_Raster | LSDRaster of elevation. |
FlowDistance | LSDRaster of flow length. |
fname | Output filename. |
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.
FlowInfo | LSDFlowInfo object. |
Elevation_Raster | LSDRaster of elevation. |
FlowDistance | LSDRaster of flow length. |
fname | Output filename. |
Discharge | The discharge raster. Can be calculated using the LSDFlowInfo upslope_variable_accumulator function |
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.
m_over_n | m over n ratio. |
A_0 | A_0 value. |
FlowInfo | LSDFlowInfo object. |
Elevation_Raster | LSDRaster of elevation. |
FlowDistance | LSDRaster of flow length. |
fname | Output filename. |
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.
m_over_n | m over n ratio. |
A_0 | A_0 value. |
FlowInfo | LSDFlowInfo object. |
Elevation_Raster | LSDRaster of elevation. |
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.
A_0 | A_0 value. |
n_movern | |
d_movern | |
start_movern | |
minimum_segment_length | |
sigma | Sigma value. |
target_nodes | |
FlowInfo | LSDFlowInfo object. |
Elevation_Raster | LSDRaster of elevation. |
fname | Output filename. |
LSDIndexRaster LSDIndexChannelTree::TributaryArray_to_LSDIndexRaster | ( | ) |
This function takes the channel tree and prints it to an LSDIndexRaster.
|
protected |
Number of rows.
|
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.