This code houses the LSDSwath object, used to make swath profiles. More...
#include <LSDSwathProfile.hpp>
Public Member Functions | |
LSDSwath (PointData &ProfilePoints, LSDRaster &RasterTemplate, float HalfWidth) | |
create an LSDSwath using a raster as a template. More... | |
LSDSwath (vector< float > &Y_X_points, LSDRaster &RasterTemplate, float &HalfWidth, float d_space) | |
create an LSDSwath using a raster as a template. More... | |
void | get_transverse_swath_profile (LSDRaster &Raster, vector< float > desired_percentiles, float BinWidth, vector< float > &mid_points, vector< float > &mean_profile, vector< float > &sd_profile, vector< vector< float > > &output_percentile_profiles, int NormaliseToBaseline) |
This moves perpendicular to the swath and gets statisics from bins of distance from the swath you can tell it what widths you want and returns a series of swaths at the mean and then percentiles you want. More... | |
void | get_longitudinal_swath_profile (LSDRaster &Raster, vector< float > desired_percentiles, float BinWidth, vector< float > &mid_points, vector< float > &mean_profile, vector< float > &sd_profile, vector< vector< float > > &output_percentile_profiles, int NormaliseToBaseline) |
This moves along the swath and gets statisics from bins of distance along the swath you can tell it what widths you want and returns a series of swaths at the mean and then percentiles you want. More... | |
LSDRaster | get_raster_from_swath_profile (LSDRaster &Raster, int NormaliseToBaseline) |
create a raster in the shape of the swath profile More... | |
LSDRaster | fill_in_channels_swath (LSDRaster &Raster) |
fill in the baseline raster value with the average value of the pixels along the transverse swath profile More... | |
vector< vector< float > > | get_connected_components_along_swath (LSDIndexRaster &ConnectedComponents, LSDRaster &RasterTemplate, int NormaliseToBaseline) |
Get information about connected components along the swath profile. More... | |
vector< vector< float > > | get_RasterValues_along_swath (LSDRaster &RasterTemplate, int NormaliseToBaseline) |
This function takes in a raster and returns the mean, min and max values of the raster at each point along the swath vector of vectors has the format: 0 = distance along swath 1 = mean value along swath 2 = min value along swath 3 = max value along swath if NormaliseToBaseline == 1 then the values will be normalised to the baseline. More... | |
void | write_RasterValues_along_swath_to_csv (LSDRaster &RasterTemplate, int NormaliseToBaseline, string csv_filename) |
Wrapper to write raster values along swath to csv. More... | |
Array2D< float > | get_BaselineDist_ConnectedComponents (LSDIndexRaster &ConnectedComponents) |
This function takes in a connected components raster and returns an array. More... | |
Array2D< float > | get_DistanceToBaseline_ConnectedComponents (LSDIndexRaster &ConnectedComponents) |
This function takes in a connected components raster and returns an array of the distance to the baseline for each pixl in the raster. More... | |
vector< float > | get_widths_along_swath (LSDIndexRaster &RasterForAnalysis) |
This function takes in a raster for analysis and gets the width of pixels in that raster. More... | |
void | write_transverse_profile_to_file (LSDRaster &Raster, vector< float > desired_percentiles, float BinWidth, string prefix, int NormaliseToBaseline) |
void | write_longitudinal_profile_to_file (LSDRaster &Raster, vector< float > desired_percentiles, float BinWidth, string prefix, int NormaliseToBaseline) |
void | print_baseline_to_csv (LSDRaster &ElevationRaster, string csv_filename, LSDFlowInfo &FlowInfo, LSDRaster &DistanceFromOutlet) |
This prints the baseline to a csv file. More... | |
void | get_locations_of_points_along_baseline (vector< float > distance_along_baseline) |
This finds locations of points along a baseline. More... | |
LSDRaster | get_raster_DistanceToBaselineArray (LSDRaster &Raster) |
This prints the DistanceToBaselineArray to a raster. More... | |
LSDRaster | get_raster_DistanceAlongBaselineArray (LSDRaster &Raster) |
This prints the DistanceAlongBaselineArray to a raster. More... | |
LSDRaster | get_raster_BaselineValueArray (LSDRaster &Raster) |
This prints the BaselineValueArray to a raster. More... | |
int | get_NPtsInProfile () const |
Array2D< float > | get_DistanceToBaselineArray () const |
Array2D< float > | get_DistanceAlongBaselineArray () const |
Array2D< float > | get_BaselineValueArray () const |
vector< float > | get_DistanceAlongBaseline () const |
float | get_XMax () const |
float | get_YMax () const |
float | get_XMin () const |
float | get_YMin () const |
float | get_ProfileHalfWidth () const |
vector< int > | get_BaselineCols () const |
vector< int > | get_BaselineRows () const |
vector< float > | get_BaselineValue () const |
This code houses the LSDSwath object, used to make swath profiles.
|
inline |
create an LSDSwath using a raster as a template.
PointData | ProfilePoints -> coordinates of points forming the baseline of the profile. |
LSDRaster | RasterTemplate -> a raster dataset that is used as a template for the swath profile i.e. any rasters that you wish to generate the profile for should have the same characteristics/spatial extent as the original template. |
float | ProfileHalfWidth |
|
inline |
create an LSDSwath using a raster as a template.
vector<vector<float> | >& Y_X_points -> coordinates of points forming the extremities of the baseline of the profile. |
LSDRaster | RasterTemplate -> a raster dataset that is used as a template for the swath profile i.e. any rasters that you wish to generate the profile for should have the same characteristics/spatial extent as the original template. |
float | ProfileHalfWidth |
fill in the baseline raster value with the average value of the pixels along the transverse swath profile
Raster | Raster template |
Array2D< float > LSDSwath::get_BaselineDist_ConnectedComponents | ( | LSDIndexRaster & | ConnectedComponents | ) |
This function takes in a connected components raster and returns an array.
ConnectedComponents | connected components raster |
vector< vector< float > > LSDSwath::get_connected_components_along_swath | ( | LSDIndexRaster & | ConnectedComponents, |
LSDRaster & | RasterTemplate, | ||
int | NormaliseToBaseline | ||
) |
Get information about connected components along the swath profile.
This function takes in a connected components raster and returns the average value of another chosen raster and distance along the baseline of each connected components patch. The user can choose whether to normalise the second raster to the baseline value. vector of vectors has the format: 0 = patch ID 1 = mean raster value for the patch id 2 = mean distance along the baseline
Array2D< float > LSDSwath::get_DistanceToBaseline_ConnectedComponents | ( | LSDIndexRaster & | ConnectedComponents | ) |
This function takes in a connected components raster and returns an array of the distance to the baseline for each pixl in the raster.
ConnectedComponents | connected components raster |
void LSDSwath::get_locations_of_points_along_baseline | ( | vector< float > | distance_along_baseline | ) |
This finds locations of points along a baseline.
A | vector of distances along the baseline |
void LSDSwath::get_longitudinal_swath_profile | ( | LSDRaster & | Raster, |
vector< float > | desired_percentiles, | ||
float | BinWidth, | ||
vector< float > & | mid_points, | ||
vector< float > & | mean_profile, | ||
vector< float > & | sd_profile, | ||
vector< vector< float > > & | output_percentile_profiles, | ||
int | NormaliseToBaseline | ||
) |
This moves along the swath and gets statisics from bins of distance along the swath you can tell it what widths you want and returns a series of swaths at the mean and then percentiles you want.
Raster | The raster from which you extract data |
desired_percentiles | A float vector that contains the percentiles of the data you want to calculate for your output profiles |
BinWidth | The width of each bin |
mid_points | A vector of the mid points, in terms of distance along, of the bins. This is overwritten during computation. |
mean_profile | A vector with the mean profile values. This is overwritten during computation. |
sd_profile | A vector with the standard deviation values. This is overwritten during computation. |
output_percentile_profiles | A vec vector where each vector is the profile at the precentile determined in the desired_percentiles vector. This is overwritten during computation. |
NormaliseToBaseline | 0 if you want the raw data, 1 if you want the data normalised to the value at the baseline. In general 1 is used to see the value along the baseline relative to that baseline so good for looking at things like terraces along a river. |
This prints the BaselineValueArray to a raster.
Raster | a raster to which the values will be printed to its geometry |
This prints the DistanceAlongBaselineArray to a raster.
Raster | a raster to which the values will be printed to its geometry |
This prints the DistanceToBaselineArray to a raster.
Raster | a raster to which the values will be printed to its geometry |
create a raster in the shape of the swath profile
Raster | LSDRaster of interest |
NormaliseToBaseline | if 0 –> raster values; if 1 –> raster values normalised to baseline value |
vector< vector< float > > LSDSwath::get_RasterValues_along_swath | ( | LSDRaster & | RasterTemplate, |
int | NormaliseToBaseline | ||
) |
This function takes in a raster and returns the mean, min and max values of the raster at each point along the swath vector of vectors has the format: 0 = distance along swath 1 = mean value along swath 2 = min value along swath 3 = max value along swath if NormaliseToBaseline == 1 then the values will be normalised to the baseline.
void LSDSwath::get_transverse_swath_profile | ( | LSDRaster & | Raster, |
vector< float > | desired_percentiles, | ||
float | BinWidth, | ||
vector< float > & | mid_points, | ||
vector< float > & | mean_profile, | ||
vector< float > & | sd_profile, | ||
vector< vector< float > > & | output_percentile_profiles, | ||
int | NormaliseToBaseline | ||
) |
This moves perpendicular to the swath and gets statisics from bins of distance from the swath you can tell it what widths you want and returns a series of swaths at the mean and then percentiles you want.
Raster | The raster from which you extract data |
desired_percentiles | A float vector that contains the percentiles of the data you want to calculate for your output profiles |
BinWidth | The width of each bin |
mid_points | A vector of the mid points, in terms of distance along, of the bins. This is overwritten during computation. |
mean_profile | A vector with the mean profile values. This is overwritten during computation. |
sd_profile | A vector with the standard deviation values. This is overwritten during computation. |
output_percentile_profiles | A vec vector where each vector is the profile at the precentile determined in the desired_percentiles vector. This is overwritten during computation. |
NormaliseToBaseline | 0 if you want the raw data, 1 if you want the data normalised to the value at the baseline. |
vector< float > LSDSwath::get_widths_along_swath | ( | LSDIndexRaster & | RasterForAnalysis | ) |
This function takes in a raster for analysis and gets the width of pixels in that raster.
RasterForAnalysis | analysis index raster |
void LSDSwath::print_baseline_to_csv | ( | LSDRaster & | ElevationRaster, |
string | csv_filename, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | DistanceFromOutlet | ||
) |
This prints the baseline to a csv file.
ElevationRaster | the raster |
csv_filename | The name of the file out |
void LSDSwath::write_RasterValues_along_swath_to_csv | ( | LSDRaster & | RasterTemplate, |
int | NormaliseToBaseline, | ||
string | csv_filename | ||
) |
Wrapper to write raster values along swath to csv.
RasterTemplate | raster of values to write |
NormaliseToBaseline | int, if 1 then will be noramlised to the baseline value. if 0 then you just get the raw underlying data |
csv_filename | file name of output csv |