This is a class to manage running LSDTopoTools. It parses a parameter file and then manages running of analyses. More...
#include <LSDAnalysisDriver.hpp>
Public Member Functions | |
LSDAnalysisDriver () | |
The default constructor. More... | |
LSDAnalysisDriver (string pname, string pfname) | |
this constructor just reads the param file given by the path and filename. You must give the parameter file extension! More... | |
void | ingest_data (string pname, string p_fname) |
This is the main function for parsing the parameter file. More... | |
void | compute_rasters_from_raster_switches () |
This looks through the raster switches, and calculates the necessary rasters. More... | |
void | write_rasters_from_analysis_switches () |
This writes rasters based on the analysis switches. More... | |
void | write_shapes_from_switches () |
This writes other forms of data based on the analysis switches. More... | |
void | read_base_raster () |
This simply loads the base raster into the vector of rasters. More... | |
void | fill_raster () |
This calculates the fill raster. More... | |
void | calculate_trimmed_and_nodata_filled () |
This calculates the trimmed and hole filled raster. More... | |
void | calculate_hillshade () |
This calculates the hillshade raster. More... | |
void | calculate_drainage_area () |
This calculates the drainage area. More... | |
void | calculate_slope () |
This calculates the slope raster. More... | |
void | calculate_slope_angle () |
This calculates the slope angle raster. More... | |
void | calculate_FS_sat () |
This calculates the Factor of safety when the hillslopes are saturated. More... | |
void | calculate_polyfit () |
This calculates the various polyfit rasters. More... | |
void | calculate_curvature_mask_threshold () |
This calculates a curvature threhsold maks. More... | |
void | calculate_mask_threshold () |
This calculates a threhsold maks. More... | |
void | calculate_flowinfo () |
This calculates the LSDFlowInfo object. More... | |
void | calculate_flow_distance () |
This calculates the LSDFlowInfo object distance from the outlet. More... | |
LSDJunctionNetwork | calculate_JunctionNetwork () |
This calculates the LSDJunctionNetwork object. More... | |
void | calculate_nodeindex () |
This gets the nodeindex from the LSDFlowInfo object IMPORTANT: this is an LSDIndexRaster so it goes into the LSDIndexRaster vector! More... | |
void | calculate_ContributingPixels () |
This gets the ContributingPixels from the LSDFlowInfo object IMPORTANT: this is an LSDIndexRaster so it goes into the LSDIndexRaster vector! More... | |
void | calculate_sources () |
This gets sources for a channel network. More... | |
void | calculate_JunctionIndex (LSDJunctionNetwork &JN) |
This calculates Junction index raster. More... | |
void | calculate_SOArray (LSDJunctionNetwork &JN) |
This calculates stream order raster. More... | |
void | calculate_chi_map () |
This calculates the chi map raster. More... | |
LSDChannel | get_single_thread_channel () |
This retrieves a single thread channel. More... | |
Protected Member Functions | |
void | check_boundary_conditions () |
This checks to see if boundary condtions have been assigned and if not defaults to no flux boundaries. More... | |
void | check_file_extensions_and_paths () |
This check to see if the filenames, paths and extensions have been assigned. If not it changes these to defaults. More... | |
void | check_pathname_for_slash () |
this adds a slash to the end of the pathname More... | |
string | check_pathname_for_slash (string this_pathname) |
this adds a slash to the end of the pathname an overloaded function: this one takes a string and returns the string with a slash at the end More... | |
void | check_polyfit () |
This checks on the polyfit functions needed. More... | |
string | get_string_before_dot (string this_string) |
this returns the string before the last dot in a string. so for example if you gave it paramfile.param it would return paramfile More... | |
Protected Attributes | |
LSDFlowInfo | FlowInfo |
This holds the flow info object. | |
bool | got_flowinfo |
the just tells the code if the flow info has already been calculated | |
bool | got_JunctionNetwork |
Pointer to junction network object. More... | |
bool | got_polyfit |
tells the code if you've done the polyfit | |
string | pathname |
the path to the datafiles | |
string | param_fname |
the name of the parameter file | |
string | dem_read_extension |
Extension for reading DEMs. Correspondence with write extensions is checked. | |
string | dem_write_extension |
Extension for writing DEMs. Correspondence with read extensions is checked. | |
string | write_path |
Path to files being written. Default is pathname. | |
string | write_fname |
file prefix of files to be written. Default is the param name prefix | |
string | read_path |
Path to files being read. Default is pathname. | |
string | read_fname |
file prefix of files to be written. Default is the param name prefix | |
vector< string > | boundary_conditions |
the four boundary conditions on the raster for the flow info object | |
map< string, bool > | analyses_switches |
This map holds all the possible analyses. | |
map< string, LSDRaster > | map_of_LSDRasters |
This vector holds various rasters computed during the run. | |
map< string, LSDIndexRaster > | map_of_LSDIndexRasters |
as above, but these are index rasters | |
map< string, bool > | raster_switches |
map< string, float > | float_parameters |
This is a map that tell where the indices into the raster vecs are. More... | |
map< string, int > | int_parameters |
This holds integer parameters. | |
map< string, vector< int > > | integer_vector_map |
This holds integer vectors. Can be used to get sources. | |
map< string, string > | support_file_names |
map< string, string > | method_map |
This is a class to manage running LSDTopoTools. It parses a parameter file and then manages running of analyses.
The intention of this object is to run analyses via parameter files and not through numerous compiled driver functions. We eventually will want some kind of 'recorder' so that any time this object runs an analysis it gives a full report of what analyses were run so that results are reproducable
|
inline |
The default constructor.
this asks for a pathname and a filename of the parameter file It then opens the paramter file and ingests the information
|
inline |
this constructor just reads the param file given by the path and filename. You must give the parameter file extension!
pname | the pathname to the parameter file |
fname | the filename of the parameter file !!INCLUDING EXTENSION!! |
void LSDAnalysisDriver::calculate_chi_map | ( | ) |
This calculates the chi map raster.
void LSDAnalysisDriver::calculate_ContributingPixels | ( | ) |
This gets the ContributingPixels from the LSDFlowInfo object IMPORTANT: this is an LSDIndexRaster so it goes into the LSDIndexRaster vector!
void LSDAnalysisDriver::calculate_curvature_mask_threshold | ( | ) |
This calculates a curvature threhsold maks.
void LSDAnalysisDriver::calculate_drainage_area | ( | ) |
This calculates the drainage area.
void LSDAnalysisDriver::calculate_flow_distance | ( | ) |
This calculates the LSDFlowInfo object distance from the outlet.
void LSDAnalysisDriver::calculate_flowinfo | ( | ) |
This calculates the LSDFlowInfo object.
void LSDAnalysisDriver::calculate_FS_sat | ( | ) |
This calculates the Factor of safety when the hillslopes are saturated.
void LSDAnalysisDriver::calculate_hillshade | ( | ) |
This calculates the hillshade raster.
void LSDAnalysisDriver::calculate_JunctionIndex | ( | LSDJunctionNetwork & | JN | ) |
This calculates Junction index raster.
LSDJunctionNetwork LSDAnalysisDriver::calculate_JunctionNetwork | ( | ) |
This calculates the LSDJunctionNetwork object.
void LSDAnalysisDriver::calculate_mask_threshold | ( | ) |
This calculates a threhsold maks.
void LSDAnalysisDriver::calculate_nodeindex | ( | ) |
This gets the nodeindex from the LSDFlowInfo object IMPORTANT: this is an LSDIndexRaster so it goes into the LSDIndexRaster vector!
void LSDAnalysisDriver::calculate_polyfit | ( | ) |
This calculates the various polyfit rasters.
void LSDAnalysisDriver::calculate_slope | ( | ) |
This calculates the slope raster.
void LSDAnalysisDriver::calculate_slope_angle | ( | ) |
This calculates the slope angle raster.
void LSDAnalysisDriver::calculate_SOArray | ( | LSDJunctionNetwork & | JN | ) |
This calculates stream order raster.
void LSDAnalysisDriver::calculate_sources | ( | ) |
This gets sources for a channel network.
void LSDAnalysisDriver::calculate_trimmed_and_nodata_filled | ( | ) |
This calculates the trimmed and hole filled raster.
|
protected |
This checks to see if boundary condtions have been assigned and if not defaults to no flux boundaries.
|
protected |
This check to see if the filenames, paths and extensions have been assigned. If not it changes these to defaults.
|
protected |
this adds a slash to the end of the pathname
|
protected |
this adds a slash to the end of the pathname an overloaded function: this one takes a string and returns the string with a slash at the end
this_pathname | the string containing the pathname the string with a slash at the end if it hasn't got one already |
|
protected |
This checks on the polyfit functions needed.
void LSDAnalysisDriver::compute_rasters_from_raster_switches | ( | ) |
This looks through the raster switches, and calculates the necessary rasters.
void LSDAnalysisDriver::fill_raster | ( | ) |
This calculates the fill raster.
LSDChannel LSDAnalysisDriver::get_single_thread_channel | ( | ) |
This retrieves a single thread channel.
|
protected |
this returns the string before the last dot in a string. so for example if you gave it paramfile.param it would return paramfile
this_string | the string you want truncated |
void LSDAnalysisDriver::ingest_data | ( | string | pname, |
string | p_fname | ||
) |
This is the main function for parsing the parameter file.
pathname | the path to the paramter file |
param_fname | the name of the parameter file |
void LSDAnalysisDriver::read_base_raster | ( | ) |
This simply loads the base raster into the vector of rasters.
void LSDAnalysisDriver::write_rasters_from_analysis_switches | ( | ) |
This writes rasters based on the analysis switches.
void LSDAnalysisDriver::write_shapes_from_switches | ( | ) |
This writes other forms of data based on the analysis switches.
|
protected |
This is a map that tell where the indices into the raster vecs are.
This holds float parameters
|
protected |
Pointer to junction network object.
tells the code if you've got the junction network
|
protected |
This holds names of methods. For example, if the key is drainage_area_method, the string is the method which is used to calculate drainage area
|
protected |
This is a map container that determines if various rasters are needed for the analysis. This ensures things like the fill raster are only calculated once
|
protected |
This holds names of supporting files, for example files that contain node of junction indices to be loaded.