Object to store information about drainage basins and generate basin average metrics.. More...
#include <LSDBasin.hpp>
Public Member Functions | |
LSDBasin () | |
Default constructor method used to create a basin object. More... | |
LSDBasin (int Junction, LSDFlowInfo &FlowInfo, LSDJunctionNetwork &ChanNet) | |
Constructor method used to create a basin object. 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 |
vector< int > | get_BasinNodes () const |
int | get_NumberOfCells () const |
float | get_Area () const |
int | get_Junction () const |
int | get_BasinOrder () const |
bool | get_Beheaded () const |
int | get_Outlet_node () const |
int | get_Outlet_i () const |
int | get_Outlet_j () const |
int | get_Centroid_i () const |
int | get_Centroid_j () const |
float | get_SlopeMean () const |
float | get_ElevationMean () const |
float | get_AspectMean () const |
float | get_ReliefMean () const |
float | get_PlanCurvMean () const |
float | get_ProfileCurvMean () const |
float | get_TotalCurvMean () const |
float | get_PlanCurvMax () const |
float | get_ProfileCurvMax () const |
float | get_TotalCurvMax () const |
float | get_HillslopeLength_HFR () const |
float | get_HillslopeLength_Binned () const |
float | get_HillslopeLength_Spline () const |
float | get_HillslopeLength_Density () const |
float | get_FlowLength () const |
float | get_DrainageDensity () const |
vector< int > | get_Perimeter_i () const |
vector< int > | get_Perimeter_j () const |
vector< int > | get_Perimeter_nodes () const |
float | get_CosmoErosionRate () const |
float | get_OtherErosionRate () const |
float | get_CHTMean () const |
float | get_EStar () const |
float | get_RStar () const |
int | get_HilltopPx () const |
float | get_BedrockFraction () const |
float | get_Biomass () const |
int | get_AlternativeIndex () const |
float | CalculateBasinMean (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the mean value of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinMax (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the max value of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinMin (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the min value of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinMedian (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the median value of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinPercentile (LSDFlowInfo &FlowInfo, LSDRaster Data, int Percentile) |
Calculate the percentile value of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinStdDev (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the Standard Deviation of values of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinStdError (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the Standard error of values of an LSDRaster which falls inside a basin. More... | |
float | CalculateBasinRange (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the range of values of an LSDRaster which falls inside a basin. More... | |
int | CalculateNumDataPoints (LSDFlowInfo &FlowInfo, LSDRaster Data) |
Calculate the number of data points of an LSDRaster which fall inside a basin. More... | |
void | set_SlopeMean (LSDFlowInfo &FlowInfo, LSDRaster Slope) |
Set the mean slope of a basin. More... | |
void | set_ElevationMean (LSDFlowInfo &FlowInfo, LSDRaster Elevation) |
Set the mean Elevation of a basin. More... | |
void | set_ReliefMean (LSDFlowInfo &FlowInfo, LSDRaster Relief) |
Set the mean Relief of a basin. More... | |
void | set_PlanCurvMean (LSDFlowInfo &FlowInfo, LSDRaster PlanCurv) |
Set the mean PlanCurve of a basin. More... | |
void | set_ProfileCurvMean (LSDFlowInfo &FlowInfo, LSDRaster ProfileCurv) |
Set the mean ProfCurv of a basin. More... | |
void | set_TotalCurvMean (LSDFlowInfo &FlowInfo, LSDRaster TotalCurv) |
Set the mean TotalCurv of a basin. More... | |
void | set_PlanCurvMax (LSDFlowInfo &FlowInfo, LSDRaster PlanCurv) |
Set the max PlanCurve of a basin. More... | |
void | set_ProfileCurvMax (LSDFlowInfo &FlowInfo, LSDRaster ProfileCurv) |
Set the max ProfCurv of a basin. More... | |
void | set_TotalCurvMax (LSDFlowInfo &FlowInfo, LSDRaster TotalCurv) |
Set the max TotalCurv of a basin. More... | |
void | set_CHTMean (LSDFlowInfo &FlowInfo, LSDRaster CHT) |
Set the mean hilltop curvature of a basin. More... | |
void | set_CosmoErosionRate (float ErosionRate) |
Set the Cosmogenic erosion rate. More... | |
void | set_OtherErosionRate (float ErosionRate) |
Set the Other erosion rate. More... | |
void | set_EStar_RStar (float CriticalSlope) |
Calculate E* and R* values for the basin, using hilltop flow routed hillslope lengths. More... | |
void | set_FlowLength (LSDIndexRaster &StreamNetwork, LSDFlowInfo &FlowInfo) |
Calculate flow length for the basin using the D8 flow directions. More... | |
void | set_DrainageDensity () |
Set basin drainage density. More... | |
void | set_HillslopeLength_HFR (LSDFlowInfo &FlowInfo, LSDRaster HillslopeLengths) |
Set the mean HillslopeLength from hilltop flow routing. More... | |
void | set_HillslopeLengths_Boomerang (LSDRaster &Slope, LSDRaster &DinfArea, LSDFlowInfo &FlowInfo, float log_bin_width, int SplineResolution, float bin_threshold) |
Set mean HillslopeLengths from boomerang plots from both splines and binned data. More... | |
void | set_HillslopeLength_Density () |
Set the mean HillslopeLength from drainage density. More... | |
void | set_BedrockFraction (LSDFlowInfo &FlowInfo, LSDRaster RockExposure) |
Set the Rock Exposure fraction of the basin. More... | |
void | set_Biomass (LSDFlowInfo &FlowInfo, LSDRaster BiomassRaster) |
void | set_AlternativeIndex (LSDFlowInfo &FlowInfo, LSDIndexRaster &AltIndex) |
void | Plot_Boomerang (LSDRaster &Slope, LSDRaster &DinfArea, LSDFlowInfo &FlowInfo, float log_bin_width, int SplineResolution, float bin_threshold, string Path) |
Generate text files containing data to plot boomerangs. More... | |
void | set_AspectMean (LSDFlowInfo &FlowInfo, LSDRaster Aspect) |
Set the mean aspect of a basin. More... | |
void | set_Perimeter (LSDFlowInfo &FlowInfo) |
Set the perimeter pixels using a simple edge detection algorithm. More... | |
void | set_perimeter_from_vector (vector< int > perimeter_nodes) |
Set the perimeter pixels by passing in your own vector of perimeter nodes. More... | |
void | print_perimeter_to_csv (LSDFlowInfo &FlowInfo, string perimeter_fname) |
Prints the perimeter nodes to a csv file. More... | |
void | print_perimeter_hypsometry_to_csv (LSDFlowInfo &FlowInfo, string perimeter_fname, LSDRaster &ElevationRaster) |
Prints the perimeter nodes to a csv file plus elevations. More... | |
vector< int > | order_perimeter_nodes (LSDFlowInfo &FlowInfo) |
Orders perimeter nodes from the outlet. More... | |
void | set_all_HillslopeLengths (LSDFlowInfo &FlowInfo, LSDRaster &HillslopeLengths, LSDRaster &Slope, LSDRaster &DinfArea, float log_bin_width, int SplineResolution, float bin_threshold) |
Set the four different hillslope length measurements for the basin. More... | |
void | set_All_Parameters (LSDRaster &Elevation, LSDFlowInfo &FlowInfo, LSDRaster &CHT, LSDIndexRaster &StreamNetwork, LSDRaster &HillslopeLengths, LSDRaster &Relief, float window_radius, float log_bin_width, int SplineResolution, float bin_threshold, float CriticalSlope, float CosmoErosionRate=-9999, float OtherErosionRate=-9999) |
Set all of the basin parameters with one call. More... | |
void | set_HilltopPx (LSDFlowInfo &FlowInfo, LSDRaster Hilltops) |
Set the count of the number of hilltop pixels in a basin. More... | |
LSDIndexRaster | write_raster_data_to_LSDIndexRaster (LSDIndexRaster Data, LSDFlowInfo FlowInfo) |
Cookie cut data from an LSDIndexRaster into the shape of the basin. More... | |
LSDRaster | write_raster_data_to_LSDRaster (LSDRaster Data, LSDFlowInfo FlowInfo) |
Cookie cut data from an LSDRaster into the shape of the basin. More... | |
int | is_node_in_basin (int test_node) |
check whether a test node is in the basin or not More... | |
bool | are_basins_from_same_base_DEM (LSDBasin &other) |
This checks the dimensions of the base DEMs along with georeferencing strings to see if the other basin is from the same DEM as the current basin. More... | |
bool | is_this_a_subbasin (LSDBasin &other) |
This checks to see if a supplied basin is a subbasin of the other. More... | |
LSDRaster | keep_only_internal_hilltop_curvature (LSDRaster hilltop_curvature, LSDFlowInfo FlowInfo) |
remove hilltop curvature values that are at the edge of the basin More... | |
LSDRaster | write_real_data_to_LSDRaster (float Param, LSDFlowInfo FlowInfo) |
Write a real value to an LSDRaster in the shape of the basin. More... | |
LSDIndexRaster | write_integer_data_to_LSDIndexRaster (int Param, LSDFlowInfo FlowInfo) |
Write an integer value to an LSDIndexRaster in the shape of the basin. More... | |
void | add_basin_to_LSDIndexRaster (LSDIndexRaster &basin_raster, LSDFlowInfo &FlowInfo, map< int, int > &drainage_of_other_basins, int this_basin_index) |
This function is used to create a single LSDIndexRaster that contains all the basins in a DEM. It is done by adding each basin in turn (but this only adds a single basin). More... | |
LSDRaster | TrimPaddedRasterToBasin (int padding_pixels, LSDFlowInfo &FlowInfo, LSDRaster &Raster_Data) |
This function creates a padded, georeferenced raster from a raw raster file that is trimmed to the dimension of a basin. More... | |
bool | is_adjacent (LSDBasin &DifferentBasin, LSDFlowInfo &flowpy) |
This function check if two basin are adjacent return true if the two basin are adjacent with at least one pixel TODO add a minimum adjacent pixel parameter. More... | |
vector< int > | get_source_node_from_perimeter (vector< int > perimeter, LSDFlowInfo &flowpy, LSDJunctionNetwork &junky, int pixel_window) |
detect the source nodes in a pixel window around a perimeter, for instance a basin perimeter It needs a sequence of nodes where it will loop around and gather all the source nodes encountered. More... | |
LSDIndexRaster | write_Junction (LSDFlowInfo FlowInfo) |
Write Junction values into the shape of the basin. More... | |
LSDIndexRaster | write_NumberOfCells (LSDFlowInfo FlowInfo) |
Write NumberOfCells values into the shape of the basin. More... | |
LSDIndexRaster | write_BasinOrder (LSDFlowInfo FlowInfo) |
Write BasinOrder values into the shape of the basin. More... | |
LSDRaster | write_Area (LSDFlowInfo FlowInfo) |
Write Area values into the shape of the basin. More... | |
LSDRaster | write_SlopeMean (LSDFlowInfo FlowInfo) |
Write SlopeMean values into the shape of the basin. More... | |
LSDRaster | write_ElevationMean (LSDFlowInfo FlowInfo) |
Write ElevationMean values into the shape of the basin. More... | |
LSDRaster | write_AspectMean (LSDFlowInfo FlowInfo) |
Write AspectMean values into the shape of the basin. More... | |
LSDRaster | write_ReliefMean (LSDFlowInfo FlowInfo) |
Write ReliefMean values into the shape of the basin. More... | |
LSDRaster | write_PlanCurvMean (LSDFlowInfo FlowInfo) |
Write PlanCurvMean values into the shape of the basin. More... | |
LSDRaster | write_ProfileCurvMean (LSDFlowInfo FlowInfo) |
Write ProfileCurvMean values into the shape of the basin. More... | |
LSDRaster | write_TotalCurvMean (LSDFlowInfo FlowInfo) |
Write TotalCurvMean values into the shape of the basin. More... | |
LSDRaster | write_PlanCurvMax (LSDFlowInfo FlowInfo) |
Write PlanCurvMax values into the shape of the basin. More... | |
LSDRaster | write_ProfileCurvMax (LSDFlowInfo FlowInfo) |
Write ProfileCurvMax values into the shape of the basin. More... | |
LSDRaster | write_TotalCurvMax (LSDFlowInfo FlowInfo) |
Write TotalCurvMax values into the shape of the basin. More... | |
LSDRaster | write_HillslopeLength_HFR (LSDFlowInfo FlowInfo) |
Write HillslopeLength_HFR values into the shape of the basin. More... | |
LSDRaster | write_HillslopeLength_Binned (LSDFlowInfo FlowInfo) |
Write HillslopeLength_Binned values into the shape of the basin. More... | |
LSDRaster | write_HillslopeLength_Spline (LSDFlowInfo FlowInfo) |
Write HillslopeLength_Spline values into the shape of the basin. More... | |
LSDRaster | write_HillslopeLength_Density (LSDFlowInfo FlowInfo) |
Write HillslopeLength_Density values into the shape of the basin. More... | |
LSDRaster | write_FlowLength (LSDFlowInfo FlowInfo) |
Write FlowLength values into the shape of the basin. More... | |
LSDRaster | write_DrainageDensity (LSDFlowInfo FlowInfo) |
Write DrainageDensity values into the shape of the basin. More... | |
LSDRaster | write_CosmoErosionRate (LSDFlowInfo FlowInfo) |
Write CosmoErosionRate values into the shape of the basin. More... | |
LSDRaster | write_OtherErosionRate (LSDFlowInfo FlowInfo) |
Write OtherErosionRate values into the shape of the basin. More... | |
LSDRaster | write_CHTMean (LSDFlowInfo FlowInfo) |
Write CHTMean values into the shape of the basin. More... | |
LSDRaster | write_EStar (LSDFlowInfo FlowInfo) |
Write EStar values into the shape of the basin. More... | |
LSDRaster | write_RStar (LSDFlowInfo FlowInfo) |
Write RStar values into the shape of the basin. More... | |
LSDRaster | Merge_Basins (vector< LSDRaster > Basins) |
Method to merge a vector of LSDRaster basins generated using LSDBasin into a single LSDRaster for visualisation. More... | |
map< int, int > | count_unique_values_from_litho_raster (LSDIndexRaster &litho, LSDFlowInfo &topo) |
Count the number of each unique lithology value contain in the basin from a topographic raster take a lithologic raster and a topographic raster in argument. More... | |
vector< int > | merge_perimeter_nodes_adjacent_basins (vector< LSDBasin > budgerigar, LSDFlowInfo &flowpy) |
merge and contour the perimeter from a vector of adjacent basins WARNING There may be 1 pixel-size holes in the perimeter. More... | |
map< string, float > | get_metrics_both_side_divide (LSDRaster &rasterTemplate, LSDFlowInfo &flowpy, vector< int > &nodes_to_test, map< int, bool > &raster_node_basin) |
Compare metrics inside/out of a basin for a given vector of nodes. Ill detail when it will be done later. More... | |
void | square_window_stat_drainage_divide (LSDRaster &rasterTemplate, LSDFlowInfo &flowpy, int size_window) |
apply a square window around each perimeter nodes and extract statistics on each sides of the basin. Ill detail when it will be done later More... | |
void | write_windowed_stats_around_drainage_divide_csv (string full_name, LSDFlowInfo &flowpy) |
void | preprocess_DD_metrics (LSDFlowInfo flowpy) |
Preprocess the Drainage Divide tool driver required info Set the perimeter and set a map containing the corresponding x,y ... TODO: add distance from origin and other global parameters. More... | |
void | organise_perimeter (LSDFlowInfo &flowpy) |
void | clean_perimeter (LSDFlowInfo &flowpy) |
void | write_elevation_csv (string output_name, LSDFlowInfo &flowpy, LSDRaster &filled) |
Write a csv file with X,Y,Z. 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 | Junction |
Junction Number of the basin, serves as a unique ID of a basin. | |
vector< int > | BasinNodes |
Vector of all nodes in basin. | |
map< int, int > | nodes_of_basins |
Map of nodes in the basin - faster to check if a node is in the basin due to a binary search tree for large maps. | |
int | NumberOfCells |
Number of DEM cells. | |
float | Area |
Area in spatial units of the basin. | |
bool | Beheaded |
Boolean to show if the basin is beheaded or not. | |
int | Outlet_i |
i index of the outlet pixel | |
int | Outlet_j |
j index of the outlet pixel | |
int | BasinOrder |
The Strahler order of the basin. | |
int | Centroid_i |
The i index of the centroid of the basin. | |
int | Centroid_j |
The j index of the centroid of the basin. | |
float | SlopeMean |
Mean basin slope. | |
float | ElevationMean |
Mean basin elevation. | |
float | AspectMean |
Mean basin aspect. | |
float | ReliefMean |
Mean basin relief. | |
float | PlanCurvMean |
Mean basin planform curvature. | |
float | ProfileCurvMean |
Mean basin profile curvature. | |
float | TotalCurvMean |
Mean basin total curvature. | |
float | PlanCurvMax |
Max basin planform curvature. | |
float | ProfileCurvMax |
Max basin profile curvature. | |
float | TotalCurvMax |
Max basin total curvature. | |
float | HillslopeLength_HFR |
Mean hillslope length from hilltop flow routing. | |
float | HillslopeLength_Binned |
Mean hillslope length from binned boomerang plots. | |
float | HillslopeLength_Spline |
Mean hillslope length from spline curves on boomerang plots. | |
float | HillslopeLength_Density |
Mean hillslope length from drainage density. | |
float | FlowLength |
Basin flowlength. | |
float | DrainageDensity |
Basin drainage density. | |
vector< int > | Perimeter_i |
Basin Perimeter's j index. | |
vector< int > | Perimeter_j |
Basin Perimeter's j index. | |
vector< int > | Perimeter_nodes |
Basin Perimeter's node index. | |
vector< int > | Perimeter_nodes_sorted |
Basin Perimeter's node index, sorted by followed order. | |
map< int, int > | Perimeter_nodes_sorted_id |
corresponding map giving an index to the sorted perimeter. Mostly for testing and debugging purposes. | |
map< int, int > | Perimeter_nodes_map |
increase the speed of checking whether a node is perimeter or not compare to find in a vector | |
float | CosmoErosionRate |
Cosmo erosion rate. | |
float | OtherErosionRate |
Other erosion rate. | |
float | CHTMean |
Mean basin hilltop curvature. | |
float | EStar |
Basin E* value. | |
float | RStar |
Basin R* value. | |
float | HilltopPx |
Number of hilltop pixels in a basin. | |
float | BedrockFraction |
Fraction of basin mapped bedrock. | |
float | Biomass |
AGB density. | |
int | AlternativeIndex |
bool | DD_preprocessed |
map< int, map< string, float > > | stats_around_perimeter_window |
map< int, float > | map_of_dist_perim |
map< int, vector< float > > | DD_map |
map< int, vector< float > > | BasinNodesMapOfXY |
Object to store information about drainage basins and generate basin average metrics..
|
inline |
Default constructor method used to create a basin object.
This is necessary since there is a derived class and with derived classes the default constructor of the parent class is automatically called
|
inline |
Constructor method used to create a basin object.
Junction | outlet junction of the basin to be constructed. |
FlowInfo | LSDFlowInfo object. |
ChanNet | Channel network object. |
void LSDBasin::add_basin_to_LSDIndexRaster | ( | LSDIndexRaster & | basin_raster, |
LSDFlowInfo & | FlowInfo, | ||
map< int, int > & | drainage_of_other_basins, | ||
int | this_basin_index | ||
) |
This function is used to create a single LSDIndexRaster that contains all the basins in a DEM. It is done by adding each basin in turn (but this only adds a single basin).
basin_raster | LSDIndexRaster containing the basin codes. It should be initialsed using write_integer_data_to_LSDIndexRaster |
FlowInfo | the flowinfo data member |
drainage_of_other_basins | This is a map where the key is an int, which has the basin number, and the value is an int, the number of pixels in the basin. It is somewhat dangerous because it does not make sure that the user is inputting unique basin numbers so some basin numbers could be overwritten |
this_basin_index | the index of the basin being added to the raster |
bool LSDBasin::are_basins_from_same_base_DEM | ( | LSDBasin & | other | ) |
This checks the dimensions of the base DEMs along with georeferencing strings to see if the other basin is from the same DEM as the current basin.
other | the other LSDBasin |
float LSDBasin::CalculateBasinMax | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the max value of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the max of. |
float LSDBasin::CalculateBasinMean | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the mean value of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the mean of. |
float LSDBasin::CalculateBasinMedian | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the median value of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the median of. |
float LSDBasin::CalculateBasinMin | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the min value of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the minimum of. |
float LSDBasin::CalculateBasinPercentile | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data, | ||
int | Percentile | ||
) |
Calculate the percentile value of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the percentile of. |
float LSDBasin::CalculateBasinRange | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the range of values of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the range of. |
float LSDBasin::CalculateBasinStdDev | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the Standard Deviation of values of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the standard deviation of. |
float LSDBasin::CalculateBasinStdError | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the Standard error of values of an LSDRaster which falls inside a basin.
FlowInfo | Flowinfo object. |
Data | Values to find the standard error of. |
int LSDBasin::CalculateNumDataPoints | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Data | ||
) |
Calculate the number of data points of an LSDRaster which fall inside a basin.
Useful for checking that an average value is not just taken from a single data point.
FlowInfo | Flowinfo object. |
Data | Values to count. |
map< int, int > LSDBasin::count_unique_values_from_litho_raster | ( | LSDIndexRaster & | litho, |
LSDFlowInfo & | topo | ||
) |
Count the number of each unique lithology value contain in the basin from a topographic raster take a lithologic raster and a topographic raster in argument.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
map< string, float > LSDBasin::get_metrics_both_side_divide | ( | LSDRaster & | rasterTemplate, |
LSDFlowInfo & | flowpy, | ||
vector< int > & | nodes_to_test, | ||
map< int, bool > & | raster_node_basin | ||
) |
Compare metrics inside/out of a basin for a given vector of nodes. Ill detail when it will be done later.
rasterTemplate | and the vector of node to test |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
vector< int > LSDBasin::get_source_node_from_perimeter | ( | vector< int > | perimeter, |
LSDFlowInfo & | flowpy, | ||
LSDJunctionNetwork & | junky, | ||
int | pixel_window | ||
) |
detect the source nodes in a pixel window around a perimeter, for instance a basin perimeter It needs a sequence of nodes where it will loop around and gather all the source nodes encountered.
vector | of nodes, Flowinfo object and a JunctionNetwork object and a number of pixel for the window. |
vector | of nodes, Flowinfo object and a JunctionNetwork object and a number of pixel for the window. |
|
inline |
|
inline |
|
inline |
|
inline |
bool LSDBasin::is_adjacent | ( | LSDBasin & | DifferentBasin, |
LSDFlowInfo & | flowpy | ||
) |
int LSDBasin::is_node_in_basin | ( | int | test_node | ) |
check whether a test node is in the basin or not
test_node | node to test |
bool LSDBasin::is_this_a_subbasin | ( | LSDBasin & | other | ) |
This checks to see if a supplied basin is a subbasin of the other.
other | the other LSDBasin |
LSDRaster LSDBasin::keep_only_internal_hilltop_curvature | ( | LSDRaster | hilltop_curvature, |
LSDFlowInfo | FlowInfo | ||
) |
remove hilltop curvature values that are at the edge of the basin
hilltop_curvature | raster of CHT |
FlowInfo | Flowinfo object |
Method to merge a vector of LSDRaster basins generated using LSDBasin into a single LSDRaster for visualisation.
50% less computationally expesnive than the old method, but still very inefficient. Does not test for overlaps in the data, will simply overwrite so that the last value to occupy a cell will be written.
Basins | vector of LSDRasters of basins. |
vector< int > LSDBasin::merge_perimeter_nodes_adjacent_basins | ( | vector< LSDBasin > | budgerigar, |
LSDFlowInfo & | flowpy | ||
) |
vector< int > LSDBasin::order_perimeter_nodes | ( | LSDFlowInfo & | FlowInfo | ) |
void LSDBasin::Plot_Boomerang | ( | LSDRaster & | Slope, |
LSDRaster & | DinfArea, | ||
LSDFlowInfo & | FlowInfo, | ||
float | log_bin_width, | ||
int | SplineResolution, | ||
float | bin_threshold, | ||
string | Path | ||
) |
Generate text files containing data to plot boomerangs.
Writes 3 files to the output path, coded with the basin's unique junction number which can the be read with python and plotted.
Slope | LSDRaster of slope. |
DinfArea | D-infinity Flowarea LSDRaster. |
FlowInfo | Flowinfo object. |
log_bin_width | Width (in log space) of the bins, with respect to D_inf. |
SplineResolution | Number of values between each point for the spline curve. |
bin_threshold | Threshold fraction of values needed to keep a bin. |
Path | The output path where the data files will be written to, including the final slash. |
void LSDBasin::preprocess_DD_metrics | ( | LSDFlowInfo | flowpy | ) |
Preprocess the Drainage Divide tool driver required info Set the perimeter and set a map containing the corresponding x,y ... TODO: add distance from origin and other global parameters.
FlowInfo | object corresponding to the original raster where the Basin has been calculated |
void LSDBasin::print_perimeter_hypsometry_to_csv | ( | LSDFlowInfo & | FlowInfo, |
string | perimeter_fname, | ||
LSDRaster & | ElevationRaster | ||
) |
Prints the perimeter nodes to a csv file plus elevations.
FlowInfo | the LSDFlowInfo object |
string | perimeter_fname |
perimeter_nodes | vector of perimeter nodes that can be passed. Pass an empty vector if you want to use the default perimeter finder. |
ElevationRaster | elevation raster |
void LSDBasin::print_perimeter_to_csv | ( | LSDFlowInfo & | FlowInfo, |
string | perimeter_fname | ||
) |
Prints the perimeter nodes to a csv file.
FlowInfo | the LSDFlowInfo object |
string | perimeter_fname |
void LSDBasin::set_all_HillslopeLengths | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster & | HillslopeLengths, | ||
LSDRaster & | Slope, | ||
LSDRaster & | DinfArea, | ||
float | log_bin_width, | ||
int | SplineResolution, | ||
float | bin_threshold | ||
) |
Set the four different hillslope length measurements for the basin.
FlowInfo | Flowinfo object. |
HillslopeLengths | LSDRaster of hillslope lengths from the hilltop flow routing method. |
Slope | LSDRaster of slope. |
DinfArea | D-infinity Flowarea LSDRaster. |
log_bin_width | Width (in log space) of the bins, with respect to D_inf. |
SplineResolution | Number of values between each point for the spline curve. |
bin_threshold | Threshold fraction of values needed to keep a bin. |
void LSDBasin::set_All_Parameters | ( | LSDRaster & | Elevation, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | CHT, | ||
LSDIndexRaster & | StreamNetwork, | ||
LSDRaster & | HillslopeLengths, | ||
LSDRaster & | Relief, | ||
float | window_radius, | ||
float | log_bin_width, | ||
int | SplineResolution, | ||
float | bin_threshold, | ||
float | CriticalSlope, | ||
float | CosmoErosionRate = -9999 , |
||
float | OtherErosionRate = -9999 |
||
) |
Set all of the basin parameters with one call.
Runs polyfit to get the elevation derivatives, so can be quite memory intensive. Method calls all the setters one by one, to populate all the basin parameters. So a basin can be created and all it's properties set with 2 calls. The erosion rates have default parameters of -9999 as these are rarely used variables.
Elevation | LSDRaster of filled elevation values. |
FlowInfo | Flowinfo object. |
CHT | LSDRaster of hilltop curvatures. |
StreamNetwork | LSDIndexRaster of the stream network. |
HillslopeLengths | LSDRaster of hillslope lengths from the hilltop flow routing method. |
Relief | LSDRaster of the hilltop relief. |
window_radius | Radius in spatial units for the polyft routine. |
log_bin_width | Width (in log space) of the bins, with respect to D_inf. Default value is 0.1. |
SplineResolution | Number of values between each point for the spline curve. Default value is 10000. |
bin_threshold | Threshold fraction of values needed to keep a bin. Default value is 0. |
CriticalSlope | Slope threshold used for E* R* calculations. Default value is 0.4. |
CosmoErosionRate | Erosion rate from cosmo. |
OtherErosionRate | Erosion rate from another source. |
void LSDBasin::set_AspectMean | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Aspect | ||
) |
Set the mean aspect of a basin.
FlowInfo | Flowinfo object. |
Aspect | Values to find the mean of. |
|
inline |
Set the Rock Exposure fraction of the basin.
|
inline |
Set the mean hilltop curvature of a basin.
FlowInfo | Flowinfo object. |
CHT | Values to find the mean of. |
|
inline |
Set the Cosmogenic erosion rate.
ErosionRate | Erosion rate - No sanity check on this value. |
|
inline |
Set basin drainage density.
|
inline |
Set the mean Elevation of a basin.
FlowInfo | Flowinfo object. |
Elevation | Values to find the mean of. |
void LSDBasin::set_EStar_RStar | ( | float | CriticalSlope | ) |
Calculate E* and R* values for the basin, using hilltop flow routed hillslope lengths.
CriticalSlope | slope threshold value, typically 0.4. |
void LSDBasin::set_FlowLength | ( | LSDIndexRaster & | StreamNetwork, |
LSDFlowInfo & | FlowInfo | ||
) |
Calculate flow length for the basin using the D8 flow directions.
StreamNetwork | the channel network. |
FlowInfo | Flowinfo object. |
|
inline |
Set the mean HillslopeLength from drainage density.
|
inline |
Set the mean HillslopeLength from hilltop flow routing.
FlowInfo | Flowinfo object. |
HillslopeLengths | Values to find the mean of. |
void LSDBasin::set_HillslopeLengths_Boomerang | ( | LSDRaster & | Slope, |
LSDRaster & | DinfArea, | ||
LSDFlowInfo & | FlowInfo, | ||
float | log_bin_width, | ||
int | SplineResolution, | ||
float | bin_threshold | ||
) |
Set mean HillslopeLengths from boomerang plots from both splines and binned data.
Slope | LSDRaster of slope. |
DinfArea | D-infinity Flowarea LSDRaster. |
FlowInfo | Flowinfo object. |
log_bin_width | Width (in log space) of the bins, with respect to D_inf. |
SplineResolution | Number of values between each point for the spline curve. |
bin_threshold | Threshold fraction of values needed to keep a bin. |
void LSDBasin::set_HilltopPx | ( | LSDFlowInfo & | FlowInfo, |
LSDRaster | Hilltops | ||
) |
Set the count of the number of hilltop pixels in a basin.
FlowInfo | Flowinfo object. |
Hilltops | a raster of hilltop data. |
|
inline |
Set the Other erosion rate.
ErosionRate | Erosion rate - No sanity check on this value. |
void LSDBasin::set_Perimeter | ( | LSDFlowInfo & | FlowInfo | ) |
Set the perimeter pixels using a simple edge detection algorithm.
This is quite messy and will be improved soon.
FlowInfo | Flowinfo object. |
|
inline |
Set the perimeter pixels by passing in your own vector of perimeter nodes.
perimeter_nodes | vector of perimeter nodes |
|
inline |
Set the max PlanCurve of a basin.
FlowInfo | Flowinfo object. |
PlanCurv | Values to find the max of. |
|
inline |
Set the mean PlanCurve of a basin.
FlowInfo | Flowinfo object. |
PlanCurv | Values to find the mean of. |
|
inline |
Set the max ProfCurv of a basin.
FlowInfo | Flowinfo object. |
ProfileCurv | Values to find the max of. |
|
inline |
Set the mean ProfCurv of a basin.
FlowInfo | Flowinfo object. |
ProfileCurv | Values to find the mean of. |
|
inline |
Set the mean Relief of a basin.
FlowInfo | Flowinfo object. |
Relief | Values to find the mean of. |
|
inline |
Set the mean slope of a basin.
FlowInfo | Flowinfo object. |
Slope | Values to find the mean of. |
|
inline |
Set the max TotalCurv of a basin.
FlowInfo | Flowinfo object. |
TotalCurv | Values to find the max of. |
|
inline |
Set the mean TotalCurv of a basin.
FlowInfo | Flowinfo object. |
TotalCurv | Values to find the mean of. |
void LSDBasin::square_window_stat_drainage_divide | ( | LSDRaster & | rasterTemplate, |
LSDFlowInfo & | flowpy, | ||
int | size_window | ||
) |
apply a square window around each perimeter nodes and extract statistics on each sides of the basin. Ill detail when it will be done later
rasterTemplate | and the vector of node to test |
LSDRaster LSDBasin::TrimPaddedRasterToBasin | ( | int | padding_pixels, |
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | Raster_Data | ||
) |
This function creates a padded, georeferenced raster from a raw raster file that is trimmed to the dimension of a basin.
Includes a padding function so that one can pad either to catch streams for CRN analysis or for wider padding to catch peaks for topographic shielding (also for CRN analysis)
padding_pixels | the number of pixels with which to pad the raster |
FlowInfo | an LSDFlowInfo object |
Raster_Data | the raster that gets trimmed. Its georeferencing needs to be the same as the basin obect georeferencing. |
|
inline |
Write Area values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write AspectMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write BasinOrder values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write CHTMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write CosmoErosionRate values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write DrainageDensity values into the shape of the basin.
FlowInfo | Flowinfo object. |
void LSDBasin::write_elevation_csv | ( | string | output_name, |
LSDFlowInfo & | flowpy, | ||
LSDRaster & | filled | ||
) |
Write a csv file with X,Y,Z.
Name | of the file and flowinfo object |
|
inline |
Write ElevationMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write EStar values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write FlowLength values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write HillslopeLength_Binned values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write HillslopeLength_Density values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write HillslopeLength_HFR values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write HillslopeLength_Spline values into the shape of the basin.
FlowInfo | Flowinfo object. |
LSDIndexRaster LSDBasin::write_integer_data_to_LSDIndexRaster | ( | int | Param, |
LSDFlowInfo | FlowInfo | ||
) |
Write an integer value to an LSDIndexRaster in the shape of the basin.
Param | integer value to be written |
FlowInfo | Flowinfo object. |
|
inline |
Write Junction values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write NumberOfCells values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write OtherErosionRate values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write PlanCurvMax values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write PlanCurvMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write ProfileCurvMax values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write ProfileCurvMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
LSDIndexRaster LSDBasin::write_raster_data_to_LSDIndexRaster | ( | LSDIndexRaster | Data, |
LSDFlowInfo | FlowInfo | ||
) |
Cookie cut data from an LSDIndexRaster into the shape of the basin.
Data | LSDIndexRaster data to be written. |
FlowInfo | Flowinfo object. |
LSDRaster LSDBasin::write_raster_data_to_LSDRaster | ( | LSDRaster | Data, |
LSDFlowInfo | FlowInfo | ||
) |
LSDRaster LSDBasin::write_real_data_to_LSDRaster | ( | float | Param, |
LSDFlowInfo | FlowInfo | ||
) |
|
inline |
Write ReliefMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write RStar values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write SlopeMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write TotalCurvMax values into the shape of the basin.
FlowInfo | Flowinfo object. |
|
inline |
Write TotalCurvMean values into the shape of the basin.
FlowInfo | Flowinfo object. |
void LSDBasin::write_windowed_stats_around_drainage_divide_csv | ( | string | full_name, |
LSDFlowInfo & | flowpy | ||
) |
write the csv file corresponding to the previously calculated windowed stTS Ill detail when it will be done later
@author | BG |