Object to create a channel network from an LSDFlowInfo object. More...
#include <LSDJunctionNetwork.hpp>
Public Member Functions | |
LSDJunctionNetwork () | |
This defines a channel network, is empty. More... | |
LSDJunctionNetwork (vector< int > Sources, LSDFlowInfo &FlowInfo) | |
This defines a channel network based on a FlowInfo object and a list of source nodes. More... | |
LSDJunctionNetwork & | operator= (const LSDJunctionNetwork &LSDR) |
Assignment operator. More... | |
void | get_UTM_information (int &UTM_zone, bool &is_North) |
this function gets the UTM_zone and a boolean that is true if the map is in the northern hemisphere More... | |
void | get_x_and_y_locations (int row, int col, double &x_loc, double &y_loc) |
this gets the x and y location of a node at row and column More... | |
void | get_x_and_y_locations (int row, int col, float &x_loc, float &y_loc) |
this gets the x and y location of a node at row and column More... | |
void | get_lat_and_long_locations (int row, int col, double &lat, double &longitude, LSDCoordinateConverterLLandUTM Converter) |
a function to get the lat and long of a node in the raster Assumes WGS84 ellipsiod More... | |
void | get_x_and_y_from_latlong (vector< float > latitude, vector< float > longitude, vector< float > &UTME, vector< float > &UTMN) |
This takes latitude and longitude (in WGS 84) and converts to vectors of easting and northing in UTM. More... | |
void | add_to_stack (int lm_index, int &j_index, int bl_node) |
Recursive add_to_stack routine to build the junction tree, from Braun and Willett (2012) equations 12 and 13. More... | |
vector< int > | get_upslope_junctions (int junction_number_outlet) |
This returns all the upstream junction of a junction_number_outlet. More... | |
vector< int > | get_all_source_junctions_of_an_outlet_junction (int junction_number_outlet) |
This finds all the junctions that are source junctions upslope of a given junction. More... | |
vector< int > | get_all_source_nodes_of_an_outlet_junction (int junction_number_outlet) |
This finds all the nodes that are source nodes upslope of a given junction. More... | |
vector< int > | get_donor_nodes (int node) |
this function gets a list of the junction indices of the donors to a particular junction IMPORTANT: this has only retained the string "node" to keep equivalence with the FlowInfo object. It takes junctions and returns junctions!! Also note that base level nodes have themselves as a donor More... | |
int | map_junction_to_upslope_junction_list (vector< int > upslope_junctions, int junction) |
This function maps a junction onto the indexing of the upslope junction list. More... | |
int | get_maximum_stream_order () |
This function returns the maximum stream order in the DEM. More... | |
int | get_number_of_streams (LSDFlowInfo &FlowInfo, int stream_order) |
This function returns the number of streams of a given stream order. More... | |
map< int, vector< float > > | calculate_junction_angles (vector< int > JunctionList, LSDFlowInfo &FlowInfo) |
This calculates the junction angles based on a number of junctions. More... | |
vector< float > | calculate_junction_angle_statistics_upstream_of_junction (int target_junction, LSDFlowInfo &FlowInfo) |
This function gets the mean and standard error of every junction angle upslope of a given junction. More... | |
vector< float > | calculate_junction_angle_statistics_upstream_of_junction (int target_junction, LSDFlowInfo &FlowInfo, int threshold_SO) |
Overloaded function similar to above but removes any junctions not greater than threshold SO. More... | |
void | calculate_junction_angle_statistics_for_order (LSDFlowInfo &FlowInfo, int BasinOrder, vector< int > &junction_list, vector< float > &junction_angle_averages, vector< float > &junction_angle_stderr, vector< int > &N_junctions) |
This takes the junction angle statistics for all basins of a given order. More... | |
void | print_junction_angles_from_basin_list (vector< int > JunctionList, LSDFlowInfo &FlowInfo, string csv_outname) |
This function takes a vector of basin junctions and prints statistics of all the junctions upstream of each basin junction to a CSV. The statstics are separated by stream order. More... | |
void | print_junction_angles_to_csv (vector< int > JunctionList, LSDFlowInfo &FlowInfo, string csv_name) |
This prints the junction angles to a csv file. More... | |
int | get_Junction_of_Node (int Node, LSDFlowInfo &FlowInfo) |
This gets the junction number of a given node. More... | |
vector< int > | get_Junctions_of_Sources (LSDFlowInfo &FlowInfo) |
This gets the junction number all the sources. More... | |
int | get_penultimate_node_from_stream_link (int upstream_junction, LSDFlowInfo &FlowInfo) |
returns the penultimate node of the stream link below given junction More... | |
LSDIndexRaster | StreamOrderArray_to_LSDIndexRaster () |
This sends the StreamOrderArray to a LSDIndexRaster. More... | |
void | StreamOrderArray_to_WGS84CSV (string FileName) |
Method to flatten an te stream order array and place the non NDV values in a csv file. Each value is placed on its own line, so that it can be read more quickly in python etc. It includes the lat long coordinates in CSV, in WGS84 coordinate system EPSG:4326. More... | |
void | PrintChannelNetworkToCSV (LSDFlowInfo &flowinfo, string fname_prefix) |
This prints a stream network to a csv in WGS84 This function prints a network that is ordered by sources, channels have stream orders and junction numbers attached param FlowInfo the flow info object which translates node indices to actual points. More... | |
LSDIndexRaster | JunctionArray_to_LSDIndexRaster () |
This sends the JunctionArray to a LSDIndexRaster. More... | |
LSDIndexRaster | JunctionIndexArray_to_LSDIndexRaster () |
This sends the JunctionIndexArray to a LSDIndexRaster. More... | |
LSDIndexRaster | StreamOrderArray_to_BinaryNetwork_LSDIndexRaster () |
Turns the StreamOrderArray into a binary rastser where 1 is channel and 0 is hillslope. More... | |
vector< int > | get_BaseLevel_DonorJunctions () |
This gets the largest donor junction to the baselevel nodes so that you can automate basin selection. (e.g. for use with chi analysis) More... | |
vector< int > | Prune_Junctions_Edge (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo) |
This function takes a list of junctions and then prunes junctions based whether they drain from the edge. This attempts to remove junctions that are through-flowing and thus do not have the correct drainage area. More... | |
vector< int > | Prune_Junctions_Edge_Ignore_Outlet_Reach (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo, LSDRaster &TestRaster) |
This function takes a list of junctions and then prunes junctions based whether they drain from the edge. This attempts to remove junctions that are through-flowing and thus do not have the correct drainage area Only gets the donor of the baselelve donor to ignore the nodes near the outlet, which often intersect nodata in cut DEMs. More... | |
vector< int > | Prune_To_Largest_Complete_Basins (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo, LSDRaster &TestRaster, LSDIndexRaster &FlowAcc) |
This function looks through all baselevel nodes and then looks for the largest basin that is not influenced by the edge. It returns a vector of these junctions. Note that it only returns one basin per baselevel node at most so might not do a great job of space filling. More... | |
vector< int > | Prune_Junctions_By_Contributing_Pixel_Window (vector< int > &Junctions_Initial, LSDFlowInfo &FlowInfo, LSDIndexRaster &FlowAcc, int lower_limit, int upper_limit) |
This function removes basins that fall outside a contributing pixel Window. More... | |
vector< int > | Prune_Junctions_By_Contributing_Pixel_Window_Remove_Nested_And_Nodata (LSDFlowInfo &FlowInfo, LSDRaster &TestRaster, LSDIndexRaster &FlowAcc, int lower_limit, int upper_limit) |
This function removes basins that fall outside a contributing pixel Window, those that are bounded by nodata, and those that are nested. A rather intensive pruning process that hopeuflly results in a number of basins that are a similar size This doesn't just look for baselevel junctions: it goes through all junctions in the DEM. Warning: computationally expensive! More... | |
vector< int > | Prune_Junctions_If_Nested (vector< int > &Junctions_Initial, LSDFlowInfo &FlowInfo, LSDIndexRaster &FlowAcc) |
This function removes basins that are nested within any other basin in the list. More... | |
vector< int > | Prune_Junctions_Area (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo, LSDIndexRaster &FlowAcc, int Threshold) |
This function takes a list of junctions and then prunes junctions based on their number of contributing pixels. More... | |
vector< int > | Prune_Junctions_Largest (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo, LSDIndexRaster &FlowAcc) |
This function takes a list of junctions retains ONLY the larges bains The junction is returned as an int vector so that it can be passed to other functions requiring junction lists. More... | |
vector< int > | Prune_Junctions_Threshold_Elevation (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo, LSDRaster &Elev, float threshold_elevation, bool keep_junctions_below_threshold) |
This function takes a list of junctions retains ONLY the junctions that have an outlet elevation greater or less than the threshold elevation Selection of greater or lower is determined by bool keep_junctions_below_threshold. More... | |
vector< int > | Prune_Junctions_Elevation_Window (vector< int > &BaseLevelJunctions_Initial, LSDFlowInfo &FlowInfo, LSDRaster &Elev, float lower_threshold, float upper_threshold) |
This function takes a list of junctions retains ONLY the junctions that have an outlet elevation with an elevation window. More... | |
vector< int > | get_contributing_pixels_from_specified_junctions (vector< int > &JunctionList, LSDFlowInfo &FlowInfo, LSDIndexRaster &FlowAcc) |
You give this a list of junction numbers and it returns the number of upslope pixels. More... | |
int | retrieve_junction_number_at_row_and_column (int row, int col) |
Get Junction number at a location. More... | |
void | print_longest_channel (int outlet_junction, LSDFlowInfo &FInfo, LSDIndexRaster &dist_code, LSDRaster &dist_from_outlet) |
Function for printing out the longest channel upstream of a point. More... | |
void | print_junction_info_vectors (string filename) |
Prints the information about the junctions to file. More... | |
LSDIndexChannel | generate_link_index_channel_from_junction (int start_junction, LSDFlowInfo &FlowInfo) |
This generates an LSDChannelIndex object given a junction. More... | |
LSDIndexChannel | generate_longest_index_channel_from_junction (int outlet_junction, LSDFlowInfo &FInfo, LSDRaster &dist_from_outlet) |
This function extracts the longest channel originating from a junction number outlet_junction. More... | |
LSDIndexChannel | generate_longest_index_channel_in_basin (int basin_junction, LSDFlowInfo &FInfo, LSDRaster &dist_from_outlet) |
This generates the longest channel in a basin. More... | |
vector< int > | get_basin_sources_from_outlet_vector (vector< int > basin_junctions, LSDFlowInfo &FlowInfo, LSDRaster &dist_from_outlet) |
This generates the upstream source nodes from a vector of basin junctions. More... | |
vector< int > | extract_basins_order_outlet_junctions (int BasinOrder, LSDFlowInfo &FlowInfo) |
This extracts the junction numbers, in a vector of integers, of all basins of a given order. More... | |
vector< int > | extract_basins_order_outlet_nodes (vector< int > &BasinOutletJunctions, LSDFlowInfo &FlowInfo) |
this function gets the outlet node of a list of basins. More... | |
void | extract_tributary_junctions_to_main_stem (LSDIndexChannel &MainStem, LSDFlowInfo &FlowInfo, vector< int > &tributary_junctions, vector< int > &nodes_on_main_stem_of_tributaries) |
This function gets tributaries along a continous channel. More... | |
vector< int > | get_pruned_tributaries_from_main_stem (LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChannelNetwork, int starting_junction, LSDRaster &DistanceFromOutlet, int pruning_switch, float pruning_threshold) |
this function gets the tributary junctions upstream of the starting_junction based on pruning criteria. More... | |
vector< int > | extract_basin_nodes_by_drainage_area (float DrainageAreaThreshold, LSDFlowInfo &FlowInfo) |
This function extracts basin nodes according to their accumulated drainage area. More... | |
vector< int > | extract_basin_nodes_above_drainage_area_threshold (LSDFlowInfo &FlowInfo, float DrainageAreaThreshold) |
This function extracts nodes where the basins of both tributaries are greater than a certain drainage area threshold. Moves downstream from sources to baselevel so that nested catchments will be selected. More... | |
vector< int > | modify_basin_nodes_from_mask (vector< int > basin_nodes, LSDFlowInfo &FlowInfo, LSDRaster &MaskRaster) |
This function checks all of the basin nodes to check if they fall within a mask (input raster). If they fall within the mask raster then the first node upstream not in the mask is selected. More... | |
vector< int > | extract_basin_junctions_from_nodes (vector< int > basin_nodes, LSDFlowInfo &FlowInfo) |
This function extracts basin junctions from a list of basin outlet nodes. More... | |
LSDIndexRaster | extract_basin_from_junction (int basin_junction, int basin_reference_number, LSDFlowInfo &FlowInfo) |
This function gets the node indices of outlets of basins of a certain order. More... | |
vector< int > | Get_Channel_Head_Junctions (vector< int > Sources, LSDFlowInfo &FlowInfo) |
This function converts a list of sources used to generate the initial channel network into a list of junction indexes of channel heads which can be used to extract hollows. More... | |
LSDIndexRaster | extract_hollow (int CH_junction, LSDFlowInfo &FlowInfo) |
This function extracts a single hollow from a given channel head junction. More... | |
LSDIndexRaster | extract_hollow (vector< int > CH_junctions, LSDFlowInfo &FlowInfo) |
This function extracts a series of hollows from a vector of channel head junctions. More... | |
LSDIndexRaster | extract_basins_from_junction_vector (vector< int > basin_junctions, LSDFlowInfo &FlowInfo) |
This function gets the an LSDIndexRaster of basins draining from a vector of junctions. More... | |
LSDIndexRaster | extract_basins_from_junction_vector_nested (vector< int > basin_junctions, LSDFlowInfo &FlowInfo) |
This function gets an LSDIndexRaster of basins draining from a vector of junctions. More... | |
LSDIndexRaster | extract_basins_from_junctions_rudimentary (vector< int > junctions, LSDFlowInfo &FlowInfo) |
This function gets the an LSDIndexRaster of basins draining from a vector of junctions. More... | |
LSDIndexRaster | ExtractBasinsOrder (int BasinOrder, LSDFlowInfo &FlowInfo) |
Basin extraction - extracts all drainage basins of specified stream order. More... | |
vector< int > | ExtractBasinJunctionOrder (int BasinOrder, LSDFlowInfo &FlowInfo) |
This function extracts the juctions of all non-beheaded drainage basins of a given order, n. More... | |
vector< int > | ExtractBasinJunctionOrderKeepEdgeBasins (int BasinOrder, LSDFlowInfo &FlowInfo) |
This function extracts the juctions of all non-beheaded drainage basins of a given order, n. Like the previous version but in this case includes basins at the edge (abutting nodata) More... | |
vector< int > | FindFarthestUpslopeHilltopsFromSources (int JunctionNumber, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance) |
Get farthest upslope hilltops. More... | |
int | GetChannelHeadsChiMethodFromNode (int NodeNumber, int MinSegLength, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster) |
This function generates LSDChannels that run from the hilltops above all the sources of the junction JunctionNumber. More... | |
int | GetChannelHeadsChiMethodFromSourceNode (int NodeNumber, int MinSegLength, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster, int NJunctions) |
This function generates LSDChannels that run from the hilltops above all the sources from the valley network down to a specified number of downstream junctions below the sources. More... | |
void | write_valley_hilltop_chi_profiles_to_csv (vector< int > sources, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster, int NJunctions, string output_path, string DEM_ID) |
This function generates LSDChannels that run from the hilltops above all the sources from the valley network down to a specified number of downstream junctions below the sources and writes the profile to csv. More... | |
LSDIndexRaster | GetChannelfromDreich (int NodeNumber, int MinSegLength, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster, string path_name, int NJunctions) |
This function generates an LSDIndexRaster of the channel that runs from the hilltop above the furthest upslope source of the junction JunctionNumber. More... | |
vector< int > | GetChannelHeadsChiMethodFromValleys (vector< int > ValleyNodes, int MinSegLength, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster) |
This function returns all potential channel heads in a DEM. It looks for channel heads organized by a basin order which is fed to the code The basin order just determines how far downstream the algorithm looks for the 'fluvial' section. It returns a vector<int> of nodeindices where the channel heads are. More... | |
vector< int > | GetChannelHeadsChiMethodFromSources (vector< int > ValleySources, int MinSegLength, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster, int NJunctions) |
This function returns all potential channel heads in a DEM. It looks for. More... | |
LSDIndexRaster | GetChannelsDreich (vector< int > ValleySources, int MinSegLength, float A_0, float m_over_n, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &ElevationRaster, string path_name, int NJunctions) |
This function returns all channels in the DEM that the DrEICH algorithm uses for segiment fitting. It looks for channels based on the outlet junctions of valleys. It returns a LSDIndexRaster with the channels. More... | |
Array2D< int > | GetChannelHeadsChiMethodAllPixels (int JunctionNumber, float A_0, float m_over_n, float bin_width, LSDFlowInfo &FlowInfo, LSDRaster &ElevationRaster) |
This function returns a 2D array containing the locations of all pixels identified as being part of the channel using chi profiles. It calculates the chi and elevation value of every pixel upstream of the given junction, then bins this data and calculates the pixels in the 95th percentile of each bin. Any pixels above the 95th percentile are considered part of the channel, and any below are considered to be hillslopes. This is the first part of the channel head prediction using chi profiles. More... | |
vector< int > | GetSourceNodesChiMethodAllPixels (int JunctionNumber, float A_0, float m_over_n, float bin_width, LSDFlowInfo &FlowInfo, LSDRaster &ElevationRaster) |
This function returns an integer vector with the node indexes of the furthest upstream pixels identified as being part of the channel using chi profiles. It calculates the chi and elevation value of every pixel upstream of the given junction, then bins this data and calculates the pixels in the 95th percentile of each bin. Any pixels above the 95th percentile are considered part of the channel, and any below are considered to be hillslopes. This is the first part of the channel head prediction using chi profiles. More... | |
vector< int > | calculate_pelletier_channel_heads (float tan_curv_threshold, LSDFlowInfo &FlowInfo, Array2D< float > &tan_curv_array) |
This function is used to predict channel head locations based on the method proposed by Pelletier (2013). More... | |
vector< int > | calculate_pelletier_channel_heads_DTM (LSDFlowInfo &FlowInfo, Array2D< float > topography, float tan_curv_threshold, Array2D< float > &tan_curv_array, Array2D< float > &tan_curv_array_LW) |
This function predicts channel head locations based on a tangential threshold as proposed by Pelletier (2013). More... | |
vector< int > | identify_upstream_limits (LSDFlowInfo &FlowInfo, Array2D< float > &topography, vector< int > source_row_vec, vector< int > source_col_vec, Array2D< float > &tan_curv) |
This function identifies upstream limit of channel network. More... | |
Array2D< int > | find_valleys (LSDFlowInfo &FlowInfo, Array2D< float > &tan_curv_array, vector< int > sources, int no_connecting_nodes, float tan_curv_threshold=0.1) |
This function is used to identify concave portions of the landscape using a tangential curvature threshold. More... | |
vector< int > | get_outlet_nodes_from_sources (LSDFlowInfo &FlowInfo, vector< int > sources) |
This function is used to get the outlet nodes from a vector of input source nodes. More... | |
Array2D< int > | find_valleys_adaptive_threshold (LSDFlowInfo &FlowInfo, Array2D< float > &tan_curv_array, vector< int > sources, int no_connecting_nodes, Array2D< float > &tan_curv_threshold) |
This function is used to identify concave portions of the landscape using a tangential curvature threshold which is adaptive for each portion of the landscape. More... | |
Array2D< int > | find_valleys_using_channel_mask (LSDFlowInfo &FlowInfo, Array2D< int > &channel_mask, vector< int > sources, int no_connecting_nodes) |
This function uses a predefined channel mask to locate valley junctions. More... | |
LSDRaster | ExtractRidges (LSDFlowInfo &FlowInfo) |
Ridge network extraction - extracts ridge network, defined as boundaries between two basins of the same stream order. More... | |
LSDRaster | ExtractRidges (LSDFlowInfo &FlowInfo, int &min_order, int &max_order) |
LSDRaster | ExtractHilltops (LSDRaster &RidgeRaster, LSDRaster &SlopeRaster, float MaxSlope) |
This last function gets the hilltops: ridges limited by a maximum slope. More... | |
LSDIndexRaster | ChannelIndexer (LSDFlowInfo &flowinfo) |
This function iterates through the junction nodes and assigns the unique junction ID to every stream pixel. More... | |
void | GetChannelNodesAndJunctions (LSDFlowInfo &flowinfo, vector< int > &NIvec, vector< int > &JIvec, vector< int > &SOvec) |
This extracts vectors containing node incidex, junction indices and stream orders of pixels in the channel network. The vectors are replaced by the method. More... | |
LSDIndexRaster | SplitChannel (LSDFlowInfo &FlowInfo, vector< int > Sources, int TargetSegmentLength) |
This function splits the channel into a series of segments, providing a convenient unit with which to analyse landscapes. The user provides the TargetSegmentLength, which specifies how many nodes should be in each segment, and a MinimumSegmentLength, which specifies the fewest permissable number of nodes. Segments smaller than this are amalgamated into the upstream segment. The algorithm loops through the sources and traces downstream, stopping a segment after the target segment length, when the stream order increases (to preserve structure of drainage network), or when a channel pixel has already been visited. More... | |
void | TypologyModel (LSDFlowInfo &FlowInfo, vector< int > Sources, vector< int > BaselineSources, vector< int > CatchIDs, vector< int > HydroCodes, int MinReachLength, int search_radius, LSDRaster &ElevationRaster, LSDRaster &DischargeRaster, LSDIndexRaster &ChannelSegments, vector< vector< int > > &SegmentInfoInts, vector< vector< float > > &SegmentInfoFloats) |
void | remove_tributary_segments (LSDFlowInfo &FlowInfo, vector< int > Sources, vector< vector< int > > &SegmentInfoInts, vector< vector< float > > &SegmentInfoFloats) |
This function removes channel segments from the typology model which are not downstream of a given list of source nodes. More... | |
void | print_channel_segments_to_csv (LSDFlowInfo &FlowInfo, vector< vector< int > > SegmentInfoInts, vector< vector< float > > SegmentInfoFloats, string outfilename) |
This function prints information about the channel segments from the TypologyModel function to a csv file so it can be read by a GIS. More... | |
LSDIndexRaster | SplitHillslopes (LSDFlowInfo &FlowInfo, LSDIndexRaster &ChannelSegmentsRaster) |
This function is intended to follow the SplitChannel function. It traces through the receiver nodes from every hillslope pixel and then assigns them an integer value that matches the index of the section of channel that is setting the base level of that hillslope. More... | |
LSDIndexRaster | SplitHillslopes (LSDFlowInfo &FlowInfo, LSDIndexRaster &ChannelSegmentsRaster, LSDIndexRaster &MultiThreadChannelRaster) |
This is an overloaded function doing the same as the previous version to segment hillslopes according to the channel index of the channel setting its base level. However, this has been adapted to include an additional input raster - MultiThreadChannelRaster - which recognises that real channels may be multithreaded and/or have widths greater than or equal to one pixel. To be rigourous, these should be removed from analyses of hillslope properties. More... | |
LSDIndexRaster | GetStreams (int order) |
Quick and dirty way to get channels of a defined stream order. More... | |
LSDIndexRaster | GetStreams (int min_order, int max_order) |
Quick and dirty way to get channels of a defined range of stream orders. More... | |
bool | node_tester (LSDFlowInfo &FlowInfo, int input_junction) |
Function to test whether a junction's upstream nodes border areas of No Data important to ensure basins are not being artificially truncated. More... | |
int | get_receiver_junction_for_specified_coordinates (float X_coordinate, float Y_coordinate, LSDFlowInfo &FlowInfo) |
Function to snap input coordinates to the nearest junction. This enables easy extraction of a particular catchment for analysis. More... | |
int | get_nodeindex_of_nearest_channel_for_specified_coordinates (float X_coordinate, float Y_coordinate, int threshold_stream_order, int search_radius_nodes, LSDFlowInfo &FlowInfo) |
Function to snap input coordinates to the nearest channel node. This enables easy extraction of a particular catchment for analysis. More... | |
int | get_junction_of_nearest_channel_from_lat_long (double latitude, double longitude, LSDFlowInfo &FlowInfo, LSDCoordinateConverterLLandUTM Converter) |
Function to snap input coordinates to the nearest channel node from latitude and longitude. More... | |
void | get_info_nearest_channel_to_node (int &StartingNode, int &threshold_SO, LSDFlowInfo &FlowInfo, LSDRaster &DistFromOutlet, int &ChannelNode, float &FlowLength, float &DistanceUpstream) |
Function to get info about the nearest channel node of a given node. More... | |
void | get_info_nearest_channel_to_node_main_stem (int &StartingNode, LSDFlowInfo &FlowInfo, LSDRaster &ElevationRaster, LSDRaster &DistFromOutlet, LSDIndexChannel &MainStem, int &ChannelNode, float &FlowLength, float &DistanceUpstream, float &Relief) |
Function to get info about the nearest channel node on the main stem of a given node. More... | |
int | find_upstream_junction_from_channel_nodeindex (int ChannelNodeIndex, LSDFlowInfo &FlowInfo) |
This function takes a node index, checks to see if it is on a channel, and then works its way up the channel to find the upstream junction. More... | |
int | check_stream_order_of_upstream_nodes (int junction, LSDFlowInfo &FlowInfo) |
This function checks whether any of the upstream nodes of a given junction are the same steam order as the junction itself. It returns an integer value which is 1 if the SO is the same and 0 if it is not the same. More... | |
int | get_upstream_node_max_stream_order (int current_node, LSDFlowInfo &FlowInfo) |
This function returns the node index of the donor node of a given node with the highest stream order. More... | |
void | snap_point_locations_to_channels (vector< float > x_locs, vector< float > y_locs, int search_radius_nodes, int threshold_stream_order, LSDFlowInfo &FlowInfo, vector< int > &valid_cosmo_points, vector< int > &snapped_node_indices, vector< int > &snapped_junction_indices) |
this function is a wrapper that takes a list of x and y locations, filters them to make sure they are in the data bounds, and then calculates the nearest channel and junction. It is primarily used to snap cosmo data to the channel network More... | |
int | find_base_level_node_of_junction (int StartingJunction) |
This functions takes a junction number and then follwos the receiver junctions until it hits a baselevel junction. More... | |
void | print_junctions_to_csv (LSDFlowInfo &FlowInfo, vector< int > JunctionList, string fname) |
Prints a list of junctions, with their locations in both UTM and in lat long WGS1984 to file The format of the file is: junction,node,x,y,latitude,longitude. More... | |
void | print_junctions_to_csv (LSDFlowInfo &FlowInfo, string fname) |
Prints all junctions, with their locations in both UTM and in lat long WGS1984 to file The format of the file is: junction,node,x,y,latitude,longitude. 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 |
map< string, string > | get_GeoReferencingStrings () const |
int | get_Node_of_Junction (int junction) const |
int | get_Receiver_of_Junction (int junction) const |
vector< int > | get_node_list_from_junction_list (vector< int > junction_list) |
vector< int > | get_node_list_of_penultimate_node_from_junction_list (vector< int > junction_list, LSDFlowInfo &FlowInfo) |
int | get_downstream_junction (int starting_junction, LSDFlowInfo &FlowInfo) |
int | get_StreamOrder_of_Node (LSDFlowInfo &FlowInfo, int node) |
int | get_StreamOrder_of_Junction (LSDFlowInfo &FlowInfo, int junction) |
int | get_StreamOrder_of_Junction (int junction) |
int | get_Next_StreamOrder_Junction (int junction) |
bool | is_junction_upstream (int current_junction, int test_junction) |
int | is_Junction_BaseLevel (int junction) |
int | get_NJunctions () const |
vector< int > | get_JunctionVector () const |
vector< int > | get_BaseLevelJunctions () const |
vector< int > | get_ReceiverVector () const |
vector< int > | get_StreamOrderVector () const |
vector< int > | get_SourcesVector () const |
Array2D< int > | get_StreamOrderArray () const |
void | couple_hillslope_nodes_to_channel_nodes (LSDRaster &Elevation, LSDFlowInfo &FlowInfo, LSDRaster &D_inf_Flowdir, LSDIndexRaster &ChannelNodeNetwork, int OutletJunction, vector< int > &hillslope_nodes, vector< int > &baselevel_channel_nodes) |
LSDRaster | calculate_relief_from_channel (LSDRaster &ElevationRaster, LSDFlowInfo &FlowInfo, int threshold_SO) |
LSDRaster | calculate_relief_from_channel_connected_components (LSDRaster &ElevationRaster, LSDIndexRaster &ConnectedComponents, LSDRaster &DistFromOutlet, LSDFlowInfo &FlowInfo, int threshold_SO, int search_distance) |
Array2D< int > | Get_Elevation_of_Nearest_Channel_for_Connected_Components (LSDIndexRaster &ConnectedComponents, LSDRaster &ElevationRaster, LSDRaster &DistFromOutlet, LSDFlowInfo &FlowInfo, int threshold_SO, int search_distance) |
float | find_mean_elevation_of_channel_reach (int StartingNode, int search_distance, LSDRaster &ElevationRaster, LSDFlowInfo &FlowInfo) |
float | find_distance_to_nearest_floodplain_pixel (int point_node, int search_distance, LSDRaster &FloodplainRaster, LSDFlowInfo &FlowInfo) |
void | get_overlapping_channels (LSDFlowInfo &FlowInfo, vector< int > BaseLevel_Junctions, LSDRaster &DistanceFromOutlet, vector< int > &source_nodes, vector< int > &outlet_nodes, int n_nodes_to_visit) |
void | get_overlapping_channels (LSDFlowInfo &FlowInfo, vector< int > BaseLevel_Junctions, LSDRaster &DistanceFromOutlet, vector< int > &source_nodes, vector< int > &outlet_nodes, vector< int > &baselevel_nodes, int n_nodes_to_visit) |
void | get_overlapping_channels_to_downstream_outlets (LSDFlowInfo &FlowInfo, vector< int > BaseLevel_Junctions, LSDRaster &DistanceFromOutlet, vector< int > &source_nodes, vector< int > &outlet_nodes, int n_nodes_to_visit) |
void | get_overlapping_channels_to_downstream_outlets (LSDFlowInfo &FlowInfo, vector< int > BaseLevel_Junctions, LSDRaster &DistanceFromOutlet, vector< int > &source_nodes, vector< int > &outlet_nodes, vector< int > &baselevel_nodes, int n_nodes_to_visit) |
I THINK THIS MIGHT CAUSE A SEG FAULT: NEED TO UPDATE!!!!! More... | |
vector< int > | get_channel_pixels_along_line (vector< int > line_rows, vector< int > line_cols, int threshold_SO, LSDFlowInfo &FlowInfo) |
void | write_river_profiles_to_csv (vector< int > &BasinJunctions, LSDFlowInfo &FlowInfo, LSDRaster &DistanceFromOutlet, LSDRaster &Elevation, string csv_filename) |
function to take a vector of basin outlet junctions and write data about the longest channel in each to csv. More... | |
void | write_river_profiles_to_csv_all_tributaries (vector< int > &BasinJunctions, LSDFlowInfo &FlowInfo, LSDRaster &DistanceFromOutlet, LSDRaster &Elevation, string csv_filename) |
function to take a vector of basin outlet junctions and write data about all tribs to csv More... | |
float | GetTotalChannelLengthUpstream (int this_node, LSDFlowInfo &FlowInfo) |
function get the total length of channels upstream of a node More... | |
void | write_river_profiles_to_csv_all_sources (float channel_length, int slope_window_size, LSDFlowInfo &FlowInfo, LSDRaster &Elevation, string csv_filename) |
function to write data about channels downstream of all channel heads for a specified length More... | |
Protected Attributes | |
int | NRows |
Number of rows. | |
int | NCols |
Number of columns. | |
float | XMinimum |
Minimum X coordinate. | |
float | YMinimum |
Minimum Y coordinate. | |
float | DataResolution |
Data resolution. | |
int | NoDataValue |
No data value. | |
map< string, string > | GeoReferencingStrings |
A map of strings for holding georeferencing information. | |
int | NJunctions |
The number of junctions. | |
vector< int > | SourcesVector |
A list of the node indices that are sources. More... | |
vector< int > | BaseLevelJunctions |
This vector lists the node index of the base level nodes that have a source within their catchements. | |
vector< int > | JunctionVector |
A list of the junctions. It is an index into the nodevector from the FlowInfo object. | |
vector< int > | StreamOrderVector |
The stream order of the junction node/link. More... | |
vector< int > | BLBasinVector |
A vector that give the baselevel index of each junction node. | |
vector< int > | NDonorsVector |
Stores the number of donors to each junction. | |
vector< int > | ReceiverVector |
Stores the node index of the receiving junction. | |
vector< int > | DeltaVector |
vector< int > | DonorStackVector |
This is a vector that stores the donor junction of of the junction and is indexed by the DeltaVector. | |
vector< int > | SVector |
This vector is used to calculate flow accumulation. More... | |
vector< int > | SVectorIndex |
This points to the starting point in the S vector of each node. | |
vector< int > | NContributingJunctions |
The number of contributing junctions !!INCULDING SELF!! to a current pixel. More... | |
Array2D< int > | StreamOrderArray |
This array stores the stream indices of all the channels. | |
Array2D< int > | JunctionArray |
This array stores a junction counter. More... | |
Array2D< int > | JunctionIndexArray |
Object to create a channel network from an LSDFlowInfo object.
|
inline |
This defines a channel network, is empty.
|
inline |
This defines a channel network based on a FlowInfo object and a list of source nodes.
FlowInfo | LSDFlowInfo object. |
Sources | vector of source nodes. |
void LSDJunctionNetwork::add_to_stack | ( | int | lm_index, |
int & | j_index, | ||
int | bl_node | ||
) |
Recursive add_to_stack routine to build the junction tree, from Braun and Willett (2012) equations 12 and 13.
lm_index | Integer |
j_index | Integer |
bl_node | Integer |
void LSDJunctionNetwork::calculate_junction_angle_statistics_for_order | ( | LSDFlowInfo & | FlowInfo, |
int | BasinOrder, | ||
vector< int > & | junction_list, | ||
vector< float > & | junction_angle_averages, | ||
vector< float > & | junction_angle_stderr, | ||
vector< int > & | N_junctions | ||
) |
This takes the junction angle statistics for all basins of a given order.
FlowInfo | the LSDFlowInfo object |
BasinOrder | the basin order of interest |
junction_list | a vector of ints holding the junctions of interest is replaced in the function |
junction_angle_averages | Average junction angles is replaced in the function |
junction_angle_stder | a vector junction angle standard errors is replaced in the function |
N_junctions | a vector of ints holding the numer of junctions in each larger basin is replaced in the function |
vector< float > LSDJunctionNetwork::calculate_junction_angle_statistics_upstream_of_junction | ( | int | target_junction, |
LSDFlowInfo & | FlowInfo | ||
) |
This function gets the mean and standard error of every junction angle upslope of a given junction.
target_junction | The target junction |
FlowInfo | an LSDFlowInfo object |
vector<float> LSDJunctionNetwork::calculate_junction_angle_statistics_upstream_of_junction | ( | int | target_junction, |
LSDFlowInfo & | FlowInfo, | ||
int | threshold_SO | ||
) |
Overloaded function similar to above but removes any junctions not greater than threshold SO.
target_junction | The target junction |
FlowInfo | an LSDFlowInfo object |
threshold_SO | threshold stream order to keep junctions (greater than this) |
map< int, vector< float > > LSDJunctionNetwork::calculate_junction_angles | ( | vector< int > | JunctionList, |
LSDFlowInfo & | FlowInfo | ||
) |
This calculates the junction angles based on a number of junctions.
JunctionList | a list of junctions |
FlowInfo | an LSDFlowInfo object |
vector< int > LSDJunctionNetwork::calculate_pelletier_channel_heads | ( | float | tan_curv_threshold, |
LSDFlowInfo & | FlowInfo, | ||
Array2D< float > & | tan_curv_array | ||
) |
This function is used to predict channel head locations based on the method proposed by Pelletier (2013).
It creates a contour curvature map and identifies channel heads as pixels greater than a user defined contour curvature threshold value, set by default at 0.1. The threshold curvature can also be defined as a multiple of the standard deviation of the curvature. Before this function is called the DEM must be filtered using the wiener filter in the LSDRasterSpectral object in order to remove high frequency noise.
Reference: Pelletier (2013) A robust, two-parameter method for the extraction of drainage networks from high-resolution digital elevation models (DEMs): Evaluation using synthetic and real-world DEMs, Water Resources Research 49: 1-15
tan_curv_threshold | Double curvature threshold value. |
FlowInfo | Flow Info object |
tan_curv_array | 2D array of tangential curvature. |
vector< int > LSDJunctionNetwork::calculate_pelletier_channel_heads_DTM | ( | LSDFlowInfo & | FlowInfo, |
Array2D< float > | topography, | ||
float | tan_curv_threshold, | ||
Array2D< float > & | tan_curv_array, | ||
Array2D< float > & | tan_curv_array_LW | ||
) |
This function predicts channel head locations based on a tangential threshold as proposed by Pelletier (2013).
This function is used to predict channel head locations based on the method proposed by Pelletier (2013). First it creates a contour curvature map and identifies channel heads as pixels with tangential curvature greater than a user defined threshold value. This map needed to be reduced to give the source pixels only. This is done by i) sorting all the possible sources by elevation and ii) routing flow from each potential source using an adaption of Freeman MD flow. Any potential sources that are located on ANY down-slope pathway within convergent part of the topography from previously visited source pixels are excluded.
Reference: Pelletier (2013) A robust, two-parameter method for the extraction of drainage networks from high-resolution digital elevation models (DEMs): Evaluation using synthetic and real-world DEMs, Water Resources Research 49: 1-15
FlowInfo | object |
raster | containing elevation data |
a | threshold value of tangential curvature |
an | array of tangential curvature |
LSDRaster LSDJunctionNetwork::calculate_relief_from_channel | ( | LSDRaster & | ElevationRaster, |
LSDFlowInfo & | FlowInfo, | ||
int | threshold_SO | ||
) |
This function calculates the relief of each pixel compared to the nearest downstream channel pixel equal or greater to the threshold stream order
ElevationRaster | LSDRaster with elevations |
FlowInfo | LSDFlowInfo object |
threshold_SO | threshold stream order to calculate relief from |
LSDRaster LSDJunctionNetwork::calculate_relief_from_channel_connected_components | ( | LSDRaster & | ElevationRaster, |
LSDIndexRaster & | ConnectedComponents, | ||
LSDRaster & | DistFromOutlet, | ||
LSDFlowInfo & | FlowInfo, | ||
int | threshold_SO, | ||
int | search_distance | ||
) |
This function calculates the relief of each pixel compared to the nearest downstream channel pixel equal or greater to the threshold stream order for that connected components patch
ElevationRaster | LSDRaster with elevations |
ConnectedComponents | connected components raster |
DistFromOutlet | raster of flow lengths |
FlowInfo | LSDFlowInfo object |
threshold_SO | original threshold stream order to calculate relief from |
LSDIndexRaster LSDJunctionNetwork::ChannelIndexer | ( | LSDFlowInfo & | flowinfo | ) |
This function iterates through the junction nodes and assigns the unique junction ID to every stream pixel.
This can be used with the LSDRaster hilltop_flow_routing function to assign a unique ID to each hilltop section tying it to a specific section of the channel network.
flowinfo | LSDFlowInfo object. |
int LSDJunctionNetwork::check_stream_order_of_upstream_nodes | ( | int | junction, |
LSDFlowInfo & | FlowInfo | ||
) |
This function checks whether any of the upstream nodes of a given junction are the same steam order as the junction itself. It returns an integer value which is 1 if the SO is the same and 0 if it is not the same.
junction | junction of interest |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::extract_basin_from_junction | ( | int | basin_junction, |
int | basin_reference_number, | ||
LSDFlowInfo & | FlowInfo | ||
) |
This function gets the node indices of outlets of basins of a certain order.
IMPORTANT: The junctions always point downstream since they can have one and only one receiver. However, for a basin of given order, this starts just upstream of the confluence to the next basin order. So the basin INCLUDES the channel flowing downstream to the penultamite node.
basin_junction | Junction of basin to be extracted. |
basin_reference_number | Reference number for printing to the IndexRaster. |
FlowInfo | LSDFlowInfo object. |
vector< int > LSDJunctionNetwork::extract_basin_junctions_from_nodes | ( | vector< int > | basin_nodes, |
LSDFlowInfo & | FlowInfo | ||
) |
This function extracts basin junctions from a list of basin outlet nodes.
basin_nodes | list of basin outlet nodes |
FlowInfo | LSDFlowInfo object |
vector< int > LSDJunctionNetwork::extract_basin_nodes_above_drainage_area_threshold | ( | LSDFlowInfo & | FlowInfo, |
float | DrainageAreaThreshold | ||
) |
This function extracts nodes where the basins of both tributaries are greater than a certain drainage area threshold. Moves downstream from sources to baselevel so that nested catchments will be selected.
FlowInfo | LSDFlowInfo object. |
DrainageAreaThreshold | Threshold drainage area. |
vector< int > LSDJunctionNetwork::extract_basin_nodes_by_drainage_area | ( | float | DrainageAreaThreshold, |
LSDFlowInfo & | FlowInfo | ||
) |
This function extracts basin nodes according to their accumulated drainage area.
Threshold | Threshold drainage area. |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::extract_basins_from_junction_vector | ( | vector< int > | basin_junctions, |
LSDFlowInfo & | FlowInfo | ||
) |
This function gets the an LSDIndexRaster of basins draining from a vector of junctions.
IMPORTANT: The junctions always point downstream since they can have one and only one receiver. However, for a basin of given order, this starts just upstream of the confluence to the next basin order. So the basin INCLUDES the channel flowing downstream to the penultamite node.
basin_junctions | Vector of junction numbers of basins to be extracted. |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::extract_basins_from_junction_vector_nested | ( | vector< int > | basin_junctions, |
LSDFlowInfo & | FlowInfo | ||
) |
This function gets an LSDIndexRaster of basins draining from a vector of junctions.
IMPORTANT: The junctions always point downstream since they can have one and only one receiver. However, for a basin of given order, this starts just upstream of the confluence to the next basin order. So the basin INCLUDES the channel flowing downstream to the penultamite node. UPDATED so that if basins are nested, they don't overwrite each other - basins are sorted by the number of contributing pixels, and the smaller basins are written first.
basin_junctions | Vector of junction numbers of basins to be extracted. |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::extract_basins_from_junctions_rudimentary | ( | vector< int > | junctions, |
LSDFlowInfo & | FlowInfo | ||
) |
This function gets the an LSDIndexRaster of basins draining from a vector of junctions.
IThis is a highly rudimentary version, which just collects all the upslope nodes.
basin_junctions | Vector of junction numbers of basins to be extracted. |
FlowInfo | LSDFlowInfo object. |
vector< int > LSDJunctionNetwork::extract_basins_order_outlet_junctions | ( | int | BasinOrder, |
LSDFlowInfo & | FlowInfo | ||
) |
This extracts the junction numbers, in a vector of integers, of all basins of a given order.
For basins, the basin includes nodes downstream of the basinJunction, until the penulatmite node in this downstream channel.
IMPORTANT: the junctions always point downstream since they can have one and only one receiver. However, for a basin of given order, this starts just upstream of the confluence to the next basin order. So the basin INCLUDES the channel flowing downstream to the penultamite node.
BasinOrder | Integer of the basin order. |
FlowInfo | LSDFlowInfo object. |
vector< int > LSDJunctionNetwork::extract_basins_order_outlet_nodes | ( | vector< int > & | BasinOutletJunctions, |
LSDFlowInfo & | FlowInfo | ||
) |
this function gets the outlet node of a list of basins.
The basin outlet node is DOWNSTREAM from the outlet junction, it is the penultamite node of the channel index.
BasinOutletJunctions | |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::extract_hollow | ( | int | CH_junction, |
LSDFlowInfo & | FlowInfo | ||
) |
This function extracts a single hollow from a given channel head junction.
The junction index of channel heads can be extracted using LSDJunctionNetwork.Get_Channel_Head_Junctions.
CH_junction | Junction index to extract. |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::extract_hollow | ( | vector< int > | CH_junctions, |
LSDFlowInfo & | FlowInfo | ||
) |
This function extracts a series of hollows from a vector of channel head junctions.
The junction index of channel heads can be extracted using LSDJunctionNetwork.Get_Channel_Head_Junctions.
CH_junctions | Vector of juntions to extract. |
FlowInfo | LSDFlowInfo object. |
void LSDJunctionNetwork::extract_tributary_junctions_to_main_stem | ( | LSDIndexChannel & | MainStem, |
LSDFlowInfo & | FlowInfo, | ||
vector< int > & | tributary_junctions, | ||
vector< int > & | nodes_on_main_stem_of_tributaries | ||
) |
This function gets tributaries along a continous channel.
What it does is goes down the index channel looking at the JunctionIndexArray to see if there is a junction. If it hits a junction then all the contributing junction it overwrites two vectors:
tributary_junctions, which lists all junctions whose reciever is the main stem and nodes_on_main_stem_of_tributaries, which are the njodes on the main_stem LSDIndexChannel where the tributaries intersect the main stem this second vector is used to calcualte the chi values of the downstream node of the tributaries.
MainStem | LSDIndexChannel of the main stem. |
FlowInfo | LSDFlowInfo object. |
tributary_junctions | |
nodes_on_main_stem_of_tributaries |
vector< int > LSDJunctionNetwork::ExtractBasinJunctionOrder | ( | int | BasinOrder, |
LSDFlowInfo & | FlowInfo | ||
) |
This function extracts the juctions of all non-beheaded drainage basins of a given order, n.
BasinOrder | Integer basin order to extract. |
FlowInfo | LSDFlowInfo object. |
vector< int > LSDJunctionNetwork::ExtractBasinJunctionOrderKeepEdgeBasins | ( | int | BasinOrder, |
LSDFlowInfo & | FlowInfo | ||
) |
This function extracts the juctions of all non-beheaded drainage basins of a given order, n. Like the previous version but in this case includes basins at the edge (abutting nodata)
BasinOrder | Integer basin order to extract. |
FlowInfo | LSDFlowInfo object. |
LSDIndexRaster LSDJunctionNetwork::ExtractBasinsOrder | ( | int | BasinOrder, |
LSDFlowInfo & | FlowInfo | ||
) |
Basin extraction - extracts all drainage basins of specified stream order.
BasinOrder | Integer basin order to extract. |
FlowInfo | LSDFlowInfo object. |
LSDRaster LSDJunctionNetwork::ExtractHilltops | ( | LSDRaster & | RidgeRaster, |
LSDRaster & | SlopeRaster, | ||
float | MaxSlope | ||
) |
This last function gets the hilltops: ridges limited by a maximum slope.
Resticts ridgeline to part of ridge network where the slope is less than a threshold value.
Now outputs an LSDRaster to fall in line with other hilltop tools - SWDG 29/8/13
RidgeRaster | LSDIndexRaster of extracted ridges. |
SlopeRaster | LSDRaster of slope. |
MaxSlope | Maximum threshold slope value. |
LSDRaster LSDJunctionNetwork::ExtractRidges | ( | LSDFlowInfo & | FlowInfo | ) |
Ridge network extraction - extracts ridge network, defined as boundaries between two basins of the same stream order.
This function extracts the ridge network by defining it as the co-boundaries of basins of equivalent order, for all basin orders within the landscape. This is relatively trivial since in each array containing the basins of the same order, each basin is labelled with a unique identifier, thus co- boundaries are found by locating pixels that neighbour pixels from another basin of the same order.
Updated to return an LSDRaster object as ridges can now be assigned CHT values, using LSDRaster::RidgeSample, which are not integers. - SWDG
FlowInfo | LSDFlowInfo object. |
LSDRaster LSDJunctionNetwork::ExtractRidges | ( | LSDFlowInfo & | FlowInfo, |
int & | min_order, | ||
int & | max_order | ||
) |
This overloaded function extracts the ridge network for a defined stream order, passed in by the user.
Updated to return an LSDRaster object as ridges can now be assigned CHT values, using LSDRaster::RidgeSample, which are not integers. - SWDG
FlowInfo | LSDFlowInfo object. |
min_order | Lowest order of ridges to extract. |
max_order | Highest order of ridges to extract. |
int LSDJunctionNetwork::find_base_level_node_of_junction | ( | int | StartingJunction | ) |
This functions takes a junction number and then follwos the receiver junctions until it hits a baselevel junction.
a | junction node to start from. |
float LSDJunctionNetwork::find_distance_to_nearest_floodplain_pixel | ( | int | point_node, |
int | search_distance, | ||
LSDRaster & | FloodplainRaster, | ||
LSDFlowInfo & | FlowInfo | ||
) |
This function returns the node index of the nearest FIP to a specified node.
point_node | Node to start with |
search_distance | Distance to search upstream and downstream for a FIP |
FloodplainRaster | Raster with binary floodplain |
FlowInfo | LSDFlowInfo object |
float LSDJunctionNetwork::find_mean_elevation_of_channel_reach | ( | int | StartingNode, |
int | search_distance, | ||
LSDRaster & | ElevationRaster, | ||
LSDFlowInfo & | FlowInfo | ||
) |
This function finds the mean elevation of the channel reach given a node on the channel network
StartingNode | node to check |
search_distance | reach distance - will check both upstream and downstream this distance |
ElevationRaster | elevation raster |
FlowInfo | LSDFlowInfo object |
int LSDJunctionNetwork::find_upstream_junction_from_channel_nodeindex | ( | int | ChannelNodeIndex, |
LSDFlowInfo & | FlowInfo | ||
) |
This function takes a node index, checks to see if it is on a channel, and then works its way up the channel to find the upstream junction.
ChannelNodeIndex | is the node index of the channel node (if it isn't a channel the function returns NoDataValue |
FlowInfo | LSDFlowInfo object. |
Array2D< int > LSDJunctionNetwork::find_valleys | ( | LSDFlowInfo & | FlowInfo, |
Array2D< float > & | tan_curv_array, | ||
vector< int > | sources, | ||
int | no_connecting_nodes, | ||
float | tan_curv_threshold = 0.1 |
||
) |
This function is used to identify concave portions of the landscape using a tangential curvature threshold.
It defines the threshold based on a multiple of the standard deviation of the curvature. It then identifies valleys in which there are a linked series of pixels which have a curvature value greater than the threshold, and finds the outlet junction number of this valley. This can be passed to the channel head prediction algorithm using the chi method.
FlowInfo | LSDFlowInfo object |
tan_curv_array | 2D array with curvature |
sources | vector with sources of channel network |
no_connecting_nodes | number of nodes that need to be above the threshold before the valley is identified |
Array2D< int > LSDJunctionNetwork::find_valleys_adaptive_threshold | ( | LSDFlowInfo & | FlowInfo, |
Array2D< float > & | tan_curv_array, | ||
vector< int > | sources, | ||
int | no_connecting_nodes, | ||
Array2D< float > & | tan_curv_threshold | ||
) |
This function is used to identify concave portions of the landscape using a tangential curvature threshold which is adaptive for each portion of the landscape.
It defines the threshold based on the standard deviation of the curvature. It then identifies valleys in which there are a linked series of pixels which have a curvature value greater than the threshold, and finds the outlet junction number of this valley. This can be passed to the channel head prediction algorithm using the chi method.
FlowInfo | LSDFlowInfo object |
tan_curv_array | 2D array with curvature |
sources | vector with sources of channel network |
no_connecting_nodes | number of nodes that need to be above the threshold before the valley is identified |
tan_curv_threshold | array with the curvature thresholds for each row and col |
Array2D< int > LSDJunctionNetwork::find_valleys_using_channel_mask | ( | LSDFlowInfo & | FlowInfo, |
Array2D< int > & | channel_mask, | ||
vector< int > | sources, | ||
int | no_connecting_nodes | ||
) |
This function uses a predefined channel mask to locate valley junctions.
This uses the same approach as the find_valleys function, but allows greater flexibility in how the valley network is defined
FlowInfo | LSDFlowInfo object |
channel_mask | 2D binary array with multi-pixel channel network marked by 1s |
sources | vector with sources of channel network |
no_connecting_nodes | number of nodes that need to be above the threshold before the valley is identified |
vector< int > LSDJunctionNetwork::FindFarthestUpslopeHilltopsFromSources | ( | int | JunctionNumber, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance | ||
) |
Get farthest upslope hilltops.
This function looks at all the source junctions in a network upstream of a given junction and returns the node index of the hilltop node that is the farthest upstream from the source junction
JunctionNumber | the junction number upstream of which you want to search for sources |
FlowInfo | the flow info object |
FlowDistance | distance upslope |
LSDIndexChannel LSDJunctionNetwork::generate_link_index_channel_from_junction | ( | int | start_junction, |
LSDFlowInfo & | FlowInfo | ||
) |
This generates an LSDChannelIndex object given a junction.
NOTE: junctions start at the upstream end of the channel section.
start_junction | Junction to extract the channel from. |
FlowInfo | LSDFlowInfo object. |
LSDIndexChannel LSDJunctionNetwork::generate_longest_index_channel_from_junction | ( | int | outlet_junction, |
LSDFlowInfo & | FInfo, | ||
LSDRaster & | dist_from_outlet | ||
) |
This function extracts the longest channel originating from a junction number outlet_junction.
outlet_junction | Outlet of junction. |
FInfo | LSDFlowInfo object. |
dist_from_outlet | Distance from outlet junction. |
LSDIndexChannel LSDJunctionNetwork::generate_longest_index_channel_in_basin | ( | int | basin_junction, |
LSDFlowInfo & | FInfo, | ||
LSDRaster & | dist_from_outlet | ||
) |
This generates the longest channel in a basin.
The basin starts where a channel of some order intersects with a channel of higher order. So the bain includes the basin junction, but also the channel flowing downstream from this basin junction. It starts from the node of the reciever junction, so if one were to extract the basin from this node one would get a basin that starts one node upstream from the lowest node in this.
basin_junction | |
FInfo | LSDFlowInfo object. |
dist_from_outlet |
vector< int > LSDJunctionNetwork::get_all_source_junctions_of_an_outlet_junction | ( | int | junction_number_outlet | ) |
This finds all the junctions that are source junctions upslope of a given junction.
junction_number_outlet | The junction number of the outlet |
vector< int > LSDJunctionNetwork::get_all_source_nodes_of_an_outlet_junction | ( | int | junction_number_outlet | ) |
This finds all the nodes that are source nodes upslope of a given junction.
junction_number_outlet | The junction number of the outlet |
vector< int > LSDJunctionNetwork::get_BaseLevel_DonorJunctions | ( | ) |
This gets the largest donor junction to the baselevel nodes so that you can automate basin selection. (e.g. for use with chi analysis)
This function returns a integer vector containing the junction number of the largest donor catchment (i.e. donor junction with greatest drainage area) upslope of each baselevel node. These can then be used as the starting locations for performing chi analysis.
IMPORTANT: the junctions always point downstream since they can have one and only one receiver. However, for a basin of given order, this starts just upstream of the confluence to the next basin order. So the basin INCLUDES the channel flowing downstream to the penultamite node.
|
inline |
vector< int > LSDJunctionNetwork::get_basin_sources_from_outlet_vector | ( | vector< int > | basin_junctions, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | dist_from_outlet | ||
) |
This generates the upstream source nodes from a vector of basin junctions.
The basin starts where a channel of some order intersects with a channel of higher order. So the bain includes the basin junction, but also the channel flowing downstream from this basin junction. It starts from the node of the reciever junction, so if one were to extract the basin from this node one would get a basin that starts one node upstream from the lowest node in this.
basin_junction | |
FInfo | LSDFlowInfo object. |
dist_from_outlet |
vector< int > LSDJunctionNetwork::Get_Channel_Head_Junctions | ( | vector< int > | Sources, |
LSDFlowInfo & | FlowInfo | ||
) |
This function converts a list of sources used to generate the initial channel network into a list of junction indexes of channel heads which can be used to extract hollows.
Sources | A vector of source nodes that correspond to channel heads. |
FlowInfo | LSDFlowInfo object. |
vector< int > LSDJunctionNetwork::get_channel_pixels_along_line | ( | vector< int > | line_rows, |
vector< int > | line_cols, | ||
int | threshold_SO, | ||
LSDFlowInfo & | FlowInfo | ||
) |
This function gets all the pixels along a line defined by a series of points and finds the pixels greater than a specified stream order.
Points | PointData object with the points |
ElevationRaster | raster of elevations |
threshold_SO | threshold stream order |
FlowInfo | LSDFlowInfo object |
vector< int > LSDJunctionNetwork::get_contributing_pixels_from_specified_junctions | ( | vector< int > & | JunctionList, |
LSDFlowInfo & | FlowInfo, | ||
LSDIndexRaster & | FlowAcc | ||
) |
You give this a list of junction numbers and it returns the number of upslope pixels.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
Threshold | The minimum number of accumulated pixels needed to keep a base level node. |
|
inline |
vector< int > LSDJunctionNetwork::get_donor_nodes | ( | int | node | ) |
this function gets a list of the junction indices of the donors to a particular junction IMPORTANT: this has only retained the string "node" to keep equivalence with the FlowInfo object. It takes junctions and returns junctions!! Also note that base level nodes have themselves as a donor
node | this is the nodeindex of the node for which you want to find the donors |
int LSDJunctionNetwork::get_downstream_junction | ( | int | starting_junction, |
LSDFlowInfo & | FlowInfo | ||
) |
Get downstream junction
starting_junction | starting junction |
FlowInfo | LSDFlowInfo object |
Array2D< int > LSDJunctionNetwork::Get_Elevation_of_Nearest_Channel_for_Connected_Components | ( | LSDIndexRaster & | ConnectedComponents, |
LSDRaster & | ElevationRaster, | ||
LSDRaster & | DistFromOutlet, | ||
LSDFlowInfo & | FlowInfo, | ||
int | threshold_SO, | ||
int | search_distance | ||
) |
This function takes in a raster of connected component patches. It finds the elevation of the nearest channel for the patch.
ConnectedComponents | connected components raster |
ElevationRaster | LSDRaster of elevations |
FlowInfo | LSDFlowInfo object |
DistFromOutlet | LSDRaster of flow lengths |
threshold_SO | threshold stream order to calculate relief from |
search_distance | length of channel reach to get elevation from |
|
inline |
void LSDJunctionNetwork::get_info_nearest_channel_to_node | ( | int & | StartingNode, |
int & | threshold_SO, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | DistFromOutlet, | ||
int & | ChannelNode, | ||
float & | FlowLength, | ||
float & | DistanceUpstream | ||
) |
Function to get info about the nearest channel node of a given node.
StartingNode | index of node of interest |
threshold_SO | threshold stream order for finding the nearest channel |
FlowInfo | LSDFlowInfo object |
DistFromOutlet | LSDRaster of flow lengths |
ChannelNode | int to store the NI of the nearest channel |
FlowLength | float to store the flow length to the nearest channel |
DistanceUpstream | float to store the distance upstream of the nearest channel |
void LSDJunctionNetwork::get_info_nearest_channel_to_node_main_stem | ( | int & | StartingNode, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | ElevationRaster, | ||
LSDRaster & | DistFromOutlet, | ||
LSDIndexChannel & | MainStem, | ||
int & | ChannelNode, | ||
float & | FlowLength, | ||
float & | DistanceUpstream, | ||
float & | Relief | ||
) |
Function to get info about the nearest channel node on the main stem of a given node.
StartingNode | index of node of interest |
FlowInfo | LSDFlowInfo object |
ElevationRaster | LSDRaster of elevations |
DistFromOutlet | LSDRaster of flow lengths |
ChannelNode | int to store the NI of the nearest channel |
FlowLength | float to store the flow length to the nearest channel |
DistanceUpstream | float to store the distance upstream of the nearest channel |
Relief | float to store relief compared to nearest channel |
int LSDJunctionNetwork::get_junction_of_nearest_channel_from_lat_long | ( | double | latitude, |
double | longitude, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDCoordinateConverterLLandUTM | Converter | ||
) |
Function to snap input coordinates to the nearest channel node from latitude and longitude.
latitude | |
longitude | |
FlowInfo | LSDFlowInfo object. |
Converter | LSDCoordinateConverterLLandUTM object |
int LSDJunctionNetwork::get_Junction_of_Node | ( | int | Node, |
LSDFlowInfo & | FlowInfo | ||
) |
This gets the junction number of a given node.
Node | |
FlowInfo | Flow Info object |
vector< int > LSDJunctionNetwork::get_Junctions_of_Sources | ( | LSDFlowInfo & | FlowInfo | ) |
This gets the junction number all the sources.
FlowInfo | Flow Info object |
|
inline |
void LSDJunctionNetwork::get_lat_and_long_locations | ( | int | row, |
int | col, | ||
double & | lat, | ||
double & | longitude, | ||
LSDCoordinateConverterLLandUTM | Converter | ||
) |
a function to get the lat and long of a node in the raster Assumes WGS84 ellipsiod
row | the row of the node |
col | the col of the node |
lat | the latitude of the node (in decimal degrees, replaced by function) Note: this is a double, because a float does not have sufficient precision relative to a UTM location (which is in metres) |
long | the longitude of the node (in decimal degrees, replaced by function) Note: this is a double, because a float does not have sufficient precision relative to a UTM location (which is in metres) |
Converter | a converter object (from LSDShapeTools) |
int LSDJunctionNetwork::get_maximum_stream_order | ( | ) |
This function returns the maximum stream order in the DEM.
|
inline |
int LSDJunctionNetwork::get_Next_StreamOrder_Junction | ( | int | junction | ) |
This gets the junction that is at the next Strahler stream order from the current junction.
junction | the current junction |
|
inline |
|
inline |
vector< int > LSDJunctionNetwork::get_node_list_from_junction_list | ( | vector< int > | junction_list | ) |
Gets a node list from a junction list
junction_list | a vector of junctions |
vector< int > LSDJunctionNetwork::get_node_list_of_penultimate_node_from_junction_list | ( | vector< int > | junction_list, |
LSDFlowInfo & | FlowInfo | ||
) |
Gets a node list from a junction list. The nodes are the penultimate nodes before the reciever juctions
junction_list | a vector of junctions |
FlowInfo | the LSDFlowInfo object |
int LSDJunctionNetwork::get_Node_of_Junction | ( | int | junction | ) | const |
Gets the node of a junction
junction | integer node index. |
int LSDJunctionNetwork::get_nodeindex_of_nearest_channel_for_specified_coordinates | ( | float | X_coordinate, |
float | Y_coordinate, | ||
int | threshold_stream_order, | ||
int | search_radius_nodes, | ||
LSDFlowInfo & | FlowInfo | ||
) |
Function to snap input coordinates to the nearest channel node. This enables easy extraction of a particular catchment for analysis.
X_coordinate | of point. In coordiantes of DEM (usually UTM). |
Y_coordinate | of point. In coordiantes of DEM (usually UTM). |
threshold_stream_order | The minimum stream order that will be considers a 'channel' by the algorithm |
search_radius_nodes | the radius of the kernal used to check if there is a nearby channel. A radius of 0 only includes the centre point, a radius of 1 has a kernal diameter of 3, radius of 2 has a kernal diameter of 5 and so on |
FlowInfo | LSDFlowInfo object. |
|
inline |
int LSDJunctionNetwork::get_number_of_streams | ( | LSDFlowInfo & | FlowInfo, |
int | stream_order | ||
) |
This function returns the number of streams of a given stream order.
FlowInfo | LSDFlowInfo object |
stream_order | Stream order of interest |
vector< int > LSDJunctionNetwork::get_outlet_nodes_from_sources | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | sources | ||
) |
This function is used to get the outlet nodes from a vector of input source nodes.
It is used to get a list of valley nodes that can be used in the DrEICH algorithm. The function goes downstream from each source node until the stream order of the downstream node is greater than that of the current node
FlowInfo | LSDFlowInfo object |
sources | vector with sources of channel network |
void LSDJunctionNetwork::get_overlapping_channels | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | BaseLevel_Junctions, | ||
LSDRaster & | DistanceFromOutlet, | ||
vector< int > & | source_nodes, | ||
vector< int > & | outlet_nodes, | ||
int | n_nodes_to_visit | ||
) |
This overwrites two vecotrs that give all of the starting and finishing nodes of channels in a basin
FlowInfo | an LSDFlowInfo object |
BaseLevel_Junctions | an integer vector that contains the base level junctions |
DistanceFromOutlet | an LSDRaster with the flow distance |
source_nodes | a vector continaing the sorted sorce nodes (by flow distance) THIS GETS OVERWRITTEN |
outlet_nodes | a vector continaing the outlet nodes THIS GETS OVERWRITTEN |
void LSDJunctionNetwork::get_overlapping_channels | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | BaseLevel_Junctions, | ||
LSDRaster & | DistanceFromOutlet, | ||
vector< int > & | source_nodes, | ||
vector< int > & | outlet_nodes, | ||
vector< int > & | baselevel_nodes, | ||
int | n_nodes_to_visit | ||
) |
This overwrites two vecotrs that give all of the starting and finishing nodes of channels in a basin
FlowInfo | an LSDFlowInfo object |
BaseLevel_Junctions | an integer vector that contains the base level junctions |
DistanceFromOutlet | an LSDRaster with the flow distance |
source_nodes | a vector continaing the sorted sorce nodes (by flow distance) THIS GETS OVERWRITTEN |
outlet_nodes | a vector continaing the outlet nodes THIS GETS OVERWRITTEN |
baselevel_nodes | a vector continaing the baselevel nodes (i.e. the node of the outlet of the basin) THIS GETS OVERWRITTEN |
void LSDJunctionNetwork::get_overlapping_channels_to_downstream_outlets | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | BaseLevel_Junctions, | ||
LSDRaster & | DistanceFromOutlet, | ||
vector< int > & | source_nodes, | ||
vector< int > & | outlet_nodes, | ||
int | n_nodes_to_visit | ||
) |
This overwrites two vectors that give all of the starting and finishing nodes of channels in a basin continuing downstream from the selected junction to its outlet
FlowInfo | an LSDFlowInfo object |
BaseLevel_Junctions | an integer vector that contains the base level junctions |
DistanceFromOutlet | an LSDRaster with the flow distance |
source_nodes | a vector continaing the sorted sorce nodes (by flow distance) THIS GETS OVERWRITTEN |
outlet_nodes | a vector continaing the outlet nodes THIS GETS OVERWRITTEN |
void LSDJunctionNetwork::get_overlapping_channels_to_downstream_outlets | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | BaseLevel_Junctions, | ||
LSDRaster & | DistanceFromOutlet, | ||
vector< int > & | source_nodes, | ||
vector< int > & | outlet_nodes, | ||
vector< int > & | baselevel_nodes, | ||
int | n_nodes_to_visit | ||
) |
I THINK THIS MIGHT CAUSE A SEG FAULT: NEED TO UPDATE!!!!!
This overwrites two vectors that give all of the starting and finishing nodes of channels in a basin continuing downstream from the selected junction to its outlet
FlowInfo | an LSDFlowInfo object |
BaseLevel_Junctions | an integer vector that contains the base level junctions |
DistanceFromOutlet | an LSDRaster with the flow distance |
source_nodes | a vector continaing the sorted sorce nodes (by flow distance) THIS GETS OVERWRITTEN |
outlet_nodes | a vector continaing the outlet nodes THIS GETS OVERWRITTEN |
baselevel_nodes | a vector continaing the baselevel nodes (i.e. the node of the outlet of the basin) THIS GETS OVERWRITTEN |
int LSDJunctionNetwork::get_penultimate_node_from_stream_link | ( | int | upstream_junction, |
LSDFlowInfo & | FlowInfo | ||
) |
returns the penultimate node of the stream link below given junction
upstream | junction of desired stream link |
FlowInfo | object |
vector< int > LSDJunctionNetwork::get_pruned_tributaries_from_main_stem | ( | LSDFlowInfo & | FlowInfo, |
LSDJunctionNetwork & | ChannelNetwork, | ||
int | starting_junction, | ||
LSDRaster & | DistanceFromOutlet, | ||
int | pruning_switch, | ||
float | pruning_threshold | ||
) |
this function gets the tributary junctions upstream of the starting_junction based on pruning criteria.
This function extracts tributaries juncions to the main stem of the channel, then selects a sample based on various criteria set by an integer called pruning switch
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
pruning_switch == 3 channels are only added if the channel order is >= threshold.
FlowInfo | LSDFlowInfo object. |
ChannelNetwork | LSDJunctionNetwork object. |
starting_junction | |
DistanceFromOutlet | LSDIndexRaster of outlet distances. |
pruning_switch | |
pruning_threshold |
int LSDJunctionNetwork::get_receiver_junction_for_specified_coordinates | ( | float | X_coordinate, |
float | Y_coordinate, | ||
LSDFlowInfo & | FlowInfo | ||
) |
Function to snap input coordinates to the nearest junction. This enables easy extraction of a particular catchment for analysis.
X_coordinate | of point. In coordiantes of DEM (usually UTM). |
Y_coordinate | of point. In coordiantes of DEM (usually UTM). |
FlowInfo | LSDFlowInfo object. |
int LSDJunctionNetwork::get_Receiver_of_Junction | ( | int | junction | ) | const |
Gets the receiver of a junction
junction | integer reciever index. |
|
inline |
|
inline |
int LSDJunctionNetwork::get_StreamOrder_of_Junction | ( | LSDFlowInfo & | FlowInfo, |
int | junction | ||
) |
Gets the stream order of a junction
FlowInfo | LSDFlowInfo object |
junction | the junction of interest |
int LSDJunctionNetwork::get_StreamOrder_of_Junction | ( | int | junction | ) |
Gets the stream order of a junction
junction | the junction of interest |
int LSDJunctionNetwork::get_StreamOrder_of_Node | ( | LSDFlowInfo & | FlowInfo, |
int | node | ||
) |
Gets the stream order of a node
FlowInfo | LSDFlowInfo object |
node | node of interest |
|
inline |
|
inline |
vector< int > LSDJunctionNetwork::get_upslope_junctions | ( | int | junction_number_outlet | ) |
This returns all the upstream junction of a junction_number_outlet.
junction_number_outlet | Integer of junction of interest. |
int LSDJunctionNetwork::get_upstream_node_max_stream_order | ( | int | current_node, |
LSDFlowInfo & | FlowInfo | ||
) |
This function returns the node index of the donor node of a given node with the highest stream order.
current_node | The current node index |
FlowInfo | LSDFlowInfo object. |
void LSDJunctionNetwork::get_UTM_information | ( | int & | UTM_zone, |
bool & | is_North | ||
) |
this function gets the UTM_zone and a boolean that is true if the map is in the northern hemisphere
UTM_zone | the UTM zone. Replaced in function. |
is_North | a boolean that is true if the DEM is in the northern hemisphere. replaced in function |
void LSDJunctionNetwork::get_x_and_y_from_latlong | ( | vector< float > | latitude, |
vector< float > | longitude, | ||
vector< float > & | UTME, | ||
vector< float > & | UTMN | ||
) |
This takes latitude and longitude (in WGS 84) and converts to vectors of easting and northing in UTM.
latitude | a vector of latitudes in UTM84 |
longitude | a vector of longitudes in WGS84 |
UTME | The easting coordinate (is overwritten) |
UTMN | The northing coordinate (is overwritten) |
void LSDJunctionNetwork::get_x_and_y_locations | ( | int | row, |
int | col, | ||
double & | x_loc, | ||
double & | y_loc | ||
) |
this gets the x and y location of a node at row and column
row | the row of the node |
col | the column of the node |
x_loc | the x location (Northing) of the node |
y_loc | the y location (Easting) of the node |
void LSDJunctionNetwork::get_x_and_y_locations | ( | int | row, |
int | col, | ||
float & | x_loc, | ||
float & | y_loc | ||
) |
this gets the x and y location of a node at row and column
row | the row of the node |
col | the column of the node |
x_loc | the x location (Northing) of the node |
y_loc | the y location (Easting) of the node |
|
inline |
|
inline |
LSDIndexRaster LSDJunctionNetwork::GetChannelfromDreich | ( | int | NodeNumber, |
int | MinSegLength, | ||
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster, | ||
string | path_name, | ||
int | NJunctions | ||
) |
This function generates an LSDIndexRaster of the channel that runs from the hilltop above the furthest upslope source of the junction JunctionNumber.
BasinOrder | |
MinSegLength | |
A_0 | |
m_over_n | |
FlowInfo | |
FlowDistance | |
ElevationRaster |
Array2D< int > LSDJunctionNetwork::GetChannelHeadsChiMethodAllPixels | ( | int | JunctionNumber, |
float | A_0, | ||
float | m_over_n, | ||
float | bin_width, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | ElevationRaster | ||
) |
This function returns a 2D array containing the locations of all pixels identified as being part of the channel using chi profiles. It calculates the chi and elevation value of every pixel upstream of the given junction, then bins this data and calculates the pixels in the 95th percentile of each bin. Any pixels above the 95th percentile are considered part of the channel, and any below are considered to be hillslopes. This is the first part of the channel head prediction using chi profiles.
JunctionNumber | |
A_0 | |
m_over_n | |
bin_width | |
FlowInfo | Flow Info object |
ElevationRaster |
int LSDJunctionNetwork::GetChannelHeadsChiMethodFromNode | ( | int | NodeNumber, |
int | MinSegLength, | ||
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster | ||
) |
This function generates LSDChannels that run from the hilltops above all the sources of the junction JunctionNumber.
int LSDJunctionNetwork::GetChannelHeadsChiMethodFromSourceNode | ( | int | NodeNumber, |
int | MinSegLength, | ||
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster, | ||
int | NJunctions | ||
) |
This function generates LSDChannels that run from the hilltops above all the sources from the valley network down to a specified number of downstream junctions below the sources.
vector< int > LSDJunctionNetwork::GetChannelHeadsChiMethodFromSources | ( | vector< int > | ValleySources, |
int | MinSegLength, | ||
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster, | ||
int | NJunctions | ||
) |
This function returns all potential channel heads in a DEM. It looks for.
channel heads based on the valley source nodes identified as concave parts of the landscape
ValleyJunctions | |
MinSegLength | |
A_0 | |
m_over_n | |
FlowInfo | |
FlowDistance | |
ElevationRaster | |
NJunctions | number of downstream junctions to run the channel profiles from |
vector< int > LSDJunctionNetwork::GetChannelHeadsChiMethodFromValleys | ( | vector< int > | ValleyNodes, |
int | MinSegLength, | ||
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster | ||
) |
This function returns all potential channel heads in a DEM. It looks for channel heads organized by a basin order which is fed to the code The basin order just determines how far downstream the algorithm looks for the 'fluvial' section. It returns a vector<int> of nodeindices where the channel heads are.
ValleyJunctions | |
MinSegLength | |
A_0 | |
m_over_n | |
FlowInfo | |
FlowDistance | |
ElevationRaster |
void LSDJunctionNetwork::GetChannelNodesAndJunctions | ( | LSDFlowInfo & | flowinfo, |
vector< int > & | NIvec, | ||
vector< int > & | JIvec, | ||
vector< int > & | SOvec | ||
) |
This extracts vectors containing node incidex, junction indices and stream orders of pixels in the channel network. The vectors are replaced by the method.
LSDIndexRaster LSDJunctionNetwork::GetChannelsDreich | ( | vector< int > | ValleySources, |
int | MinSegLength, | ||
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster, | ||
string | path_name, | ||
int | NJunctions | ||
) |
This function returns all channels in the DEM that the DrEICH algorithm uses for segiment fitting. It looks for channels based on the outlet junctions of valleys. It returns a LSDIndexRaster with the channels.
ValleyNodes | |
MinSegLength | |
A_0 | |
m_over_n | |
FlowInfo | |
FlowDistance | |
ElevationRaster |
vector< int > LSDJunctionNetwork::GetSourceNodesChiMethodAllPixels | ( | int | JunctionNumber, |
float | A_0, | ||
float | m_over_n, | ||
float | bin_width, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | ElevationRaster | ||
) |
This function returns an integer vector with the node indexes of the furthest upstream pixels identified as being part of the channel using chi profiles. It calculates the chi and elevation value of every pixel upstream of the given junction, then bins this data and calculates the pixels in the 95th percentile of each bin. Any pixels above the 95th percentile are considered part of the channel, and any below are considered to be hillslopes. This is the first part of the channel head prediction using chi profiles.
JunctionNumber | |
A_0 | |
m_over_n | |
bin_width | |
FlowInfo | Flow Info object |
ElevationRaster |
LSDIndexRaster LSDJunctionNetwork::GetStreams | ( | int | order | ) |
Quick and dirty way to get channels of a defined stream order.
No input error handling, will return an LSDIndexRaster of NoDataValues if an erroneous order is passed in.
order | Integer of the required stream order. |
LSDIndexRaster LSDJunctionNetwork::GetStreams | ( | int | min_order, |
int | max_order | ||
) |
Quick and dirty way to get channels of a defined range of stream orders.
No input error handling, will return an LSDIndexRaster of NoDataValues if an erroneous order is passed in.
min_order | Integer of the miniumum required stream order. |
max_order | Integer of the max required stream order. |
float LSDJunctionNetwork::GetTotalChannelLengthUpstream | ( | int | this_node, |
LSDFlowInfo & | FlowInfo | ||
) |
function get the total length of channels upstream of a node
this_node | node of interest |
FlowInfo | LSDFlowInfo object |
vector< int > LSDJunctionNetwork::identify_upstream_limits | ( | LSDFlowInfo & | FlowInfo, |
Array2D< float > & | topography, | ||
vector< int > | source_row_vec, | ||
vector< int > | source_col_vec, | ||
Array2D< float > & | tan_curv | ||
) |
This function identifies upstream limit of channel network.
This is used to reduce a map of channel pixels down to a vector of sources for channel extraction. It finds the upstream limit of each channel and then removes channelised pixels that are on ANY downslope pathway, within convergent part of the topography, from previous sources. It uses a similar algorithm to the Freeman multi-directional flow routing algorithm in the LSDRaster object.
FlowInfo | object |
raster | containing elevation data |
a | vector of row coordinates for possible source pixels |
a | vector of column coordinates for possible source pixels |
an | array of tangential curvature |
int LSDJunctionNetwork::is_Junction_BaseLevel | ( | int | junction | ) |
Returns an integer to check whether junction is at base level.
junction | the junction of interest @ return int 1 = base level, 0 = not base level |
bool LSDJunctionNetwork::is_junction_upstream | ( | int | current_junction, |
int | test_junction | ||
) |
Returns an bool to check whether junction is upstream of another base level
current_junction | the junction of interest |
test_junction | the junction to see if it is upstream @ return true or false |
LSDIndexRaster LSDJunctionNetwork::JunctionArray_to_LSDIndexRaster | ( | ) |
This sends the JunctionArray to a LSDIndexRaster.
LSDIndexRaster LSDJunctionNetwork::JunctionIndexArray_to_LSDIndexRaster | ( | ) |
This sends the JunctionIndexArray to a LSDIndexRaster.
int LSDJunctionNetwork::map_junction_to_upslope_junction_list | ( | vector< int > | upslope_junctions, |
int | junction | ||
) |
This function maps a junction onto the indexing of the upslope junction list.
If you get an upslope junction list the indexing starts at the furthest downslope junction. All of the junction pointing refers to the master junction list however.
upslope_junctions | Vector of upslope junctions of interest. |
junction | Integer of junction of interest. |
vector< int > LSDJunctionNetwork::modify_basin_nodes_from_mask | ( | vector< int > | basin_nodes, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | MaskRaster | ||
) |
This function checks all of the basin nodes to check if they fall within a mask (input raster). If they fall within the mask raster then the first node upstream not in the mask is selected.
basin_nodes | vector of basin nodes |
FlowInfo | LSDFlowInfo object |
MaskRaster | raster to use as mask |
bool LSDJunctionNetwork::node_tester | ( | LSDFlowInfo & | FlowInfo, |
int | input_junction | ||
) |
Function to test whether a junction's upstream nodes border areas of No Data important to ensure basins are not being artificially truncated.
FlowInfo | LSDFlowInfo object. |
input_junction | Junction to be tested. |
LSDJunctionNetwork & LSDJunctionNetwork::operator= | ( | const LSDJunctionNetwork & | LSDR | ) |
Assignment operator.
the copy constructor
void LSDJunctionNetwork::print_channel_segments_to_csv | ( | LSDFlowInfo & | FlowInfo, |
vector< vector< int > > | SegmentInfoInts, | ||
vector< vector< float > > | SegmentInfoFloats, | ||
string | outfilename | ||
) |
This function prints information about the channel segments from the TypologyModel function to a csv file so it can be read by a GIS.
FlowInfo | LSDFlowInfo object |
SegmentInfoInts | vec<vec> of segment info (integer) |
SegmentInfoFloats | vec<vec> of segment info (floating point) |
outfilename | string, csv filename |
void LSDJunctionNetwork::print_junction_angles_from_basin_list | ( | vector< int > | JunctionList, |
LSDFlowInfo & | FlowInfo, | ||
string | csv_outname | ||
) |
This function takes a vector of basin junctions and prints statistics of all the junctions upstream of each basin junction to a CSV. The statstics are separated by stream order.
JunctionList | list of basin junctions |
FlowInfo | LSDFlowInfo object |
csv_outname | name of output csv |
void LSDJunctionNetwork::print_junction_angles_to_csv | ( | vector< int > | JunctionList, |
LSDFlowInfo & | FlowInfo, | ||
string | csv_name | ||
) |
This prints the junction angles to a csv file.
JunctionList | The list of junctions to analyze. If this is an empty vector, the code analyses all junctions in the DEM |
FlowInfo | The LSDFlowInfo object |
csv_name | The name of the file. Needs full path and csv extension |
void LSDJunctionNetwork::print_junction_info_vectors | ( | string | filename | ) |
Prints the information about the junctions to file.
filename | Output filename to be appended with '.txt'. |
void LSDJunctionNetwork::print_junctions_to_csv | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | JunctionList, | ||
string | fname | ||
) |
Prints a list of junctions, with their locations in both UTM and in lat long WGS1984 to file The format of the file is: junction,node,x,y,latitude,longitude.
FlowInfo | an LSDFlowInfo object |
JunctionList | A list of junctions in an integer vector |
fname | The filename of the csv file |
void LSDJunctionNetwork::print_junctions_to_csv | ( | LSDFlowInfo & | FlowInfo, |
string | fname | ||
) |
Prints all junctions, with their locations in both UTM and in lat long WGS1984 to file The format of the file is: junction,node,x,y,latitude,longitude.
FlowInfo | an LSDFlowInfo object |
fname | The filename of the csv file |
void LSDJunctionNetwork::print_longest_channel | ( | int | outlet_junction, |
LSDFlowInfo & | FInfo, | ||
LSDIndexRaster & | dist_code, | ||
LSDRaster & | dist_from_outlet | ||
) |
Function for printing out the longest channel upstream of a point.
outlet_junction | |
FInfo | LSDFlowInfo object. |
dist_code | |
dist_from_outlet |
void LSDJunctionNetwork::PrintChannelNetworkToCSV | ( | LSDFlowInfo & | flowinfo, |
string | fname_prefix | ||
) |
This prints a stream network to a csv in WGS84 This function prints a network that is ordered by sources, channels have stream orders and junction numbers attached param FlowInfo the flow info object which translates node indices to actual points.
FileName_prefix | The prefix of the file to write, if no path is included it will write to the current directory. The csv extension is added automatically. |
vector< int > LSDJunctionNetwork::Prune_Junctions_Area | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDIndexRaster & | FlowAcc, | ||
int | Threshold | ||
) |
This function takes a list of junctions and then prunes junctions based on their number of contributing pixels.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
Threshold | The minimum number of accumulated pixels needed to keep a base level node. |
vector< int > LSDJunctionNetwork::Prune_Junctions_By_Contributing_Pixel_Window | ( | vector< int > & | Junctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDIndexRaster & | FlowAcc, | ||
int | lower_limit, | ||
int | upper_limit | ||
) |
This function removes basins that fall outside a contributing pixel Window.
Junctions_Initial | a vector of integers containg an inital list of junctions |
FlowInfo | The LSDFlowInfo object |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
lower_limit | The minimum number of contributing pixels |
upper_limit | The maximum number of contributing pixels |
vector< int > LSDJunctionNetwork::Prune_Junctions_By_Contributing_Pixel_Window_Remove_Nested_And_Nodata | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster & | TestRaster, | ||
LSDIndexRaster & | FlowAcc, | ||
int | lower_limit, | ||
int | upper_limit | ||
) |
This function removes basins that fall outside a contributing pixel Window, those that are bounded by nodata, and those that are nested. A rather intensive pruning process that hopeuflly results in a number of basins that are a similar size This doesn't just look for baselevel junctions: it goes through all junctions in the DEM. Warning: computationally expensive!
FlowInfo | The LSDFlowInfo object |
TestRaster | A raster that is just used to look for nodata |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
lower_limit | The minimum number of contributing pixels |
upper_limit | The maximum number of contributing pixels |
vector< int > LSDJunctionNetwork::Prune_Junctions_Edge | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo | ||
) |
This function takes a list of junctions and then prunes junctions based whether they drain from the edge. This attempts to remove junctions that are through-flowing and thus do not have the correct drainage area.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
vector< int > LSDJunctionNetwork::Prune_Junctions_Edge_Ignore_Outlet_Reach | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | TestRaster | ||
) |
This function takes a list of junctions and then prunes junctions based whether they drain from the edge. This attempts to remove junctions that are through-flowing and thus do not have the correct drainage area Only gets the donor of the baselelve donor to ignore the nodes near the outlet, which often intersect nodata in cut DEMs.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
TestRaster | A raster that is just used to look for nodata |
vector< int > LSDJunctionNetwork::Prune_Junctions_Elevation_Window | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | Elev, | ||
float | lower_threshold, | ||
float | upper_threshold | ||
) |
This function takes a list of junctions retains ONLY the junctions that have an outlet elevation with an elevation window.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
Elev | an LSDRaster of elevation |
lower_threshold | the lower threshold elevation |
upper_threshold | the lower threshold elevation |
vector< int > LSDJunctionNetwork::Prune_Junctions_If_Nested | ( | vector< int > & | Junctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDIndexRaster & | FlowAcc | ||
) |
This function removes basins that are nested within any other basin in the list.
Junctions_Initial | a vector of integers containg an inital list of junctions |
FlowInfo | The LSDFlowInfo object |
TestRaster | A raster that is just used to look for nodata |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
vector< int > LSDJunctionNetwork::Prune_Junctions_Largest | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDIndexRaster & | FlowAcc | ||
) |
This function takes a list of junctions retains ONLY the larges bains The junction is returned as an int vector so that it can be passed to other functions requiring junction lists.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
vector< int > LSDJunctionNetwork::Prune_Junctions_Threshold_Elevation | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | Elev, | ||
float | threshold_elevation, | ||
bool | keep_junctions_below_threshold | ||
) |
This function takes a list of junctions retains ONLY the junctions that have an outlet elevation greater or less than the threshold elevation Selection of greater or lower is determined by bool keep_junctions_below_threshold.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
Elev | an LSDRaster of elevation |
threshold_elevation | the threshold elevation to kepp |
keep_junctions_below_threshold | if true keep junctions below threshold |
vector< int > LSDJunctionNetwork::Prune_To_Largest_Complete_Basins | ( | vector< int > & | BaseLevelJunctions_Initial, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | TestRaster, | ||
LSDIndexRaster & | FlowAcc | ||
) |
This function looks through all baselevel nodes and then looks for the largest basin that is not influenced by the edge. It returns a vector of these junctions. Note that it only returns one basin per baselevel node at most so might not do a great job of space filling.
BaseLevelJunctions_Initial | a vector of integers containg an inital list of base level nodes |
FlowInfo | The LSDFlowInfo object |
TestRaster | A raster that is just used to look for nodata |
FlowAcc | an LSDIndexRaster with the number of pixels for flow accumulation |
void LSDJunctionNetwork::remove_tributary_segments | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | Sources, | ||
vector< vector< int > > & | SegmentInfoInts, | ||
vector< vector< float > > & | SegmentInfoFloats | ||
) |
This function removes channel segments from the typology model which are not downstream of a given list of source nodes.
FlowInfo | LSDFlowInfo object |
Sources | vector of source nodes |
SegmentInfoInts | vec<vec> of segment info (integer) |
SegmentInfoFloats | vec<vec> of segment info (floating point) |
|
inline |
Get Junction number at a location.
row | Integer row index. |
col | Integer column index. |
void LSDJunctionNetwork::snap_point_locations_to_channels | ( | vector< float > | x_locs, |
vector< float > | y_locs, | ||
int | search_radius_nodes, | ||
int | threshold_stream_order, | ||
LSDFlowInfo & | FlowInfo, | ||
vector< int > & | valid_cosmo_points, | ||
vector< int > & | snapped_node_indices, | ||
vector< int > & | snapped_junction_indices | ||
) |
this function is a wrapper that takes a list of x and y locations, filters them to make sure they are in the data bounds, and then calculates the nearest channel and junction. It is primarily used to snap cosmo data to the channel network
x_locs | the x locations of the points |
y_locs | the y locations of the points |
search_radius_nodes | the number of nodes around the point to search for a channel |
threshold_stream_order | the minimum stream order to which the point will snap |
FlowInfo | the LSDFlowInfo object |
valid_cosmo_points | a vector<int> of indices into the x and y vectors. for example if the only valid points were at x_loc[12] and x_loc[34] this would return a vector with two elements, 12 and 34. This vector is overwritten by this function |
snapped_node_indices | a vector containing the node indices of the points snapped to the nearest channel (within search radius and over the drainage order threshold). This is overwritten by this method. |
snapped_junction_indices | a vector<int> continaing the junction numbers downstream of the nearest channel node. This is overwritten by this method. |
LSDIndexRaster LSDJunctionNetwork::SplitChannel | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | Sources, | ||
int | TargetSegmentLength | ||
) |
This function splits the channel into a series of segments, providing a convenient unit with which to analyse landscapes. The user provides the TargetSegmentLength, which specifies how many nodes should be in each segment, and a MinimumSegmentLength, which specifies the fewest permissable number of nodes. Segments smaller than this are amalgamated into the upstream segment. The algorithm loops through the sources and traces downstream, stopping a segment after the target segment length, when the stream order increases (to preserve structure of drainage network), or when a channel pixel has already been visited.
SplitChannel
FlowInfo | LSDFlowInfo object |
Sources | a vector of sources |
TargetSegmentLength | (suggest 200 for 1m DEM) |
LSDIndexRaster LSDJunctionNetwork::SplitHillslopes | ( | LSDFlowInfo & | FlowInfo, |
LSDIndexRaster & | ChannelSegmentsRaster | ||
) |
This function is intended to follow the SplitChannel function. It traces through the receiver nodes from every hillslope pixel and then assigns them an integer value that matches the index of the section of channel that is setting the base level of that hillslope.
SplitHillslopes
FlowInfo | LSDFlowInfo object |
ChannelSegmentsRaster | a raster of channel segments, produced by the SplitChannel function |
LSDIndexRaster LSDJunctionNetwork::SplitHillslopes | ( | LSDFlowInfo & | FlowInfo, |
LSDIndexRaster & | ChannelSegmentsRaster, | ||
LSDIndexRaster & | MultiThreadChannelRaster | ||
) |
This is an overloaded function doing the same as the previous version to segment hillslopes according to the channel index of the channel setting its base level. However, this has been adapted to include an additional input raster - MultiThreadChannelRaster - which recognises that real channels may be multithreaded and/or have widths greater than or equal to one pixel. To be rigourous, these should be removed from analyses of hillslope properties.
SplitHillslopes
FlowInfo | LSDFlowInfo object |
ChannelSegmentsRaster | a raster of channel segments, produced by the SplitChannel function |
MultiThreadChannelRaster | a binary raster with the full channel extent |
LSDIndexRaster LSDJunctionNetwork::StreamOrderArray_to_BinaryNetwork_LSDIndexRaster | ( | ) |
Turns the StreamOrderArray into a binary rastser where 1 is channel and 0 is hillslope.
LSDIndexRaster LSDJunctionNetwork::StreamOrderArray_to_LSDIndexRaster | ( | ) |
This sends the StreamOrderArray to a LSDIndexRaster.
void LSDJunctionNetwork::StreamOrderArray_to_WGS84CSV | ( | string | FileName | ) |
Method to flatten an te stream order array and place the non NDV values in a csv file. Each value is placed on its own line, so that it can be read more quickly in python etc. It includes the lat long coordinates in CSV, in WGS84 coordinate system EPSG:4326.
FileName_prefix | The prefix of the file to write, if no path is included it will write to the current directory. The csv extension is added automatically. |
void LSDJunctionNetwork::TypologyModel | ( | LSDFlowInfo & | FlowInfo, |
vector< int > | Sources, | ||
vector< int > | BaselineSources, | ||
vector< int > | CatchIDs, | ||
vector< int > | HydroCodes, | ||
int | MinReachLength, | ||
int | search_radius, | ||
LSDRaster & | ElevationRaster, | ||
LSDRaster & | DischargeRaster, | ||
LSDIndexRaster & | ChannelSegments, | ||
vector< vector< int > > & | SegmentInfoInts, | ||
vector< vector< float > > & | SegmentInfoFloats | ||
) |
TypologyModel
This function splits the channel into a series of segments, providing a convenient unit with which to analyse landscapes. Function modified from original SplitChannel function so that the segment length varies with the drainage area of the cahtchment. Length (m) is calculated based on: L = Min_reach_length * sqrt(Drainage Area (km)) User must pass in the minimum reach length in metres The algorithm starts a new segment either after the target length, when the stream order increases, or when a channel pixel has already been visited. User must pass in an empty IndexRaster which will be populated with the channel segments data, and two vector of vectors which will be populated: vector< vector<int> > SegmentInfoInts has the following layout: 0 - segment IDS 1 - start node of each segment (upstream) 2 - end nodes (downstream) vector< vector<float> > SegmentInfoFloats has the following layout: 0 - segment lengths 1 - elevation of the start nodes 2 - slope of the segment
FlowInfo | LSDFlowInfo object |
Sources | a vector of sources |
BaselineSources | vector of baseline DRN sources |
CatchIDs | vector of catchment IDs from DRN |
HydroCodes | vector of hydrocodes from DRN |
MinReachLength | in metres |
search_radius | search radius for snapping rasters to the channel segments (pixels) |
ElevationRaster | raster with elevation values |
DischargeRaster | raster with discharge values (CEH one is in l/second, weirdly) |
ChannelSegments | empty LSDIndexRaster, returned with channel segments labelled by unique ID |
SegmentInfoInt | vec<vec> with integer segment info |
SegmentInfoFloat | vec<vec> with floating segment info |
void LSDJunctionNetwork::write_river_profiles_to_csv | ( | vector< int > & | BasinJunctions, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | DistanceFromOutlet, | ||
LSDRaster & | Elevation, | ||
string | csv_filename | ||
) |
function to take a vector of basin outlet junctions and write data about the longest channel in each to csv.
BasinJunctions | vector of basin junctions |
FlowInfo | |
DistanceFromOutlet | |
Elevation | elev raster |
csv_filename | the output csv file name |
void LSDJunctionNetwork::write_river_profiles_to_csv_all_sources | ( | float | channel_length, |
int | slope_window_size, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | Elevation, | ||
string | csv_filename | ||
) |
function to write data about channels downstream of all channel heads for a specified length
channel_length | length downstream to stop writing info |
FlowInfo | |
Elevation | elev raster |
csv_filename | the output csv file name |
void LSDJunctionNetwork::write_river_profiles_to_csv_all_tributaries | ( | vector< int > & | BasinJunctions, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | DistanceFromOutlet, | ||
LSDRaster & | Elevation, | ||
string | csv_filename | ||
) |
function to take a vector of basin outlet junctions and write data about all tribs to csv
BasinJunctions | vector of basin junctions |
FlowInfo | |
DistanceFromOutlet | |
Elevation | elev raster |
csv_filename | the output csv file name |
void LSDJunctionNetwork::write_valley_hilltop_chi_profiles_to_csv | ( | vector< int > | sources, |
float | A_0, | ||
float | m_over_n, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | ElevationRaster, | ||
int | NJunctions, | ||
string | output_path, | ||
string | DEM_ID | ||
) |
This function generates LSDChannels that run from the hilltops above all the sources from the valley network down to a specified number of downstream junctions below the sources and writes the profile to csv.
|
protected |
Stores the delta vector which is used to index into the donor stack and order contributing junction see Braun and Willett [2012].
|
protected |
This array stores a junction counter.
If zero there is no junction
if 1 it is a junction unvisted by the junction gathering algorithm
if 2 or more it is a previously visited junction
|
protected |
This is an array where the elements are nodata if there is no junction and an integer indicating the junction number.
|
protected |
The number of contributing junctions !!INCULDING SELF!! to a current pixel.
It is used in conjunction with the SVectorIndex to build basins upslope of any and all nodes in the junction list.
|
protected |
A list of the node indices that are sources.
Note: are not the node indices not junctions. To find the junctions you need to use the get_Junction_of_Node member function
|
protected |
The stream order of the junction node/link.
Note that each junction has one and only one receiver junction so the stream order of a junction node will apply to all nodes along the path to the next junction.
|
protected |
This vector is used to calculate flow accumulation.
For each base level junction it progresses from a hilltop to a confluence and then jumps to the next hilltop so that by cascading down through the node indices in this list one can quickly calculate drainage area, discharge, sediment flux, etc.