LSDTopoTools
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LSDAnalysisDriver Class Reference

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, LSDRastermap_of_LSDRasters
 This vector holds various rasters computed during the run.
 
map< string, LSDIndexRastermap_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
 

Detailed Description

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

Constructor & Destructor Documentation

LSDAnalysisDriver::LSDAnalysisDriver ( )
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

Author
SMM
Date
29/07/2014
LSDAnalysisDriver::LSDAnalysisDriver ( string  pname,
string  pfname 
)
inline

this constructor just reads the param file given by the path and filename. You must give the parameter file extension!

Parameters
pnamethe pathname to the parameter file
fnamethe filename of the parameter file !!INCLUDING EXTENSION!!
Author
SMM
Date
29/07/2014

Member Function Documentation

void LSDAnalysisDriver::calculate_chi_map ( )

This calculates the chi map raster.

Author
SMM
Date
30/07/2014
void LSDAnalysisDriver::calculate_ContributingPixels ( )

This gets the ContributingPixels from the LSDFlowInfo object IMPORTANT: this is an LSDIndexRaster so it goes into the LSDIndexRaster vector!

Author
SMM
Date
30/07/2014
void LSDAnalysisDriver::calculate_curvature_mask_threshold ( )

This calculates a curvature threhsold maks.

Author
SMM
Date
09/09/2016
void LSDAnalysisDriver::calculate_drainage_area ( )

This calculates the drainage area.

Author
SMM
Date
23/09/2014
void LSDAnalysisDriver::calculate_flow_distance ( )

This calculates the LSDFlowInfo object distance from the outlet.

Author
SMM
Date
24/09/2014
void LSDAnalysisDriver::calculate_flowinfo ( )

This calculates the LSDFlowInfo object.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::calculate_FS_sat ( )

This calculates the Factor of safety when the hillslopes are saturated.

Author
SMM
Date
13/11/2014
void LSDAnalysisDriver::calculate_hillshade ( )

This calculates the hillshade raster.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::calculate_JunctionIndex ( LSDJunctionNetwork JN)

This calculates Junction index raster.

Author
SMM
Date
30/07/2014
LSDJunctionNetwork LSDAnalysisDriver::calculate_JunctionNetwork ( )

This calculates the LSDJunctionNetwork object.

Returns
JunctionNetork: the junction network
Author
SMM
Date
30/07/2014
void LSDAnalysisDriver::calculate_mask_threshold ( )

This calculates a threhsold maks.

Author
SMM
Date
28/09/2016
void LSDAnalysisDriver::calculate_nodeindex ( )

This gets the nodeindex from the LSDFlowInfo object IMPORTANT: this is an LSDIndexRaster so it goes into the LSDIndexRaster vector!

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::calculate_polyfit ( )

This calculates the various polyfit rasters.

Author
SMM
Date
21/09/2014
void LSDAnalysisDriver::calculate_slope ( )

This calculates the slope raster.

Author
SMM
Date
21/09/2014
void LSDAnalysisDriver::calculate_slope_angle ( )

This calculates the slope angle raster.

Author
SMM
Date
13/11/2014
void LSDAnalysisDriver::calculate_SOArray ( LSDJunctionNetwork JN)

This calculates stream order raster.

Author
SMM
Date
30/07/2014
void LSDAnalysisDriver::calculate_sources ( )

This gets sources for a channel network.

Author
SMM
Date
30/07/2014
void LSDAnalysisDriver::calculate_trimmed_and_nodata_filled ( )

This calculates the trimmed and hole filled raster.

Author
SMM
Date
10/12/2014
void LSDAnalysisDriver::check_boundary_conditions ( )
protected

This checks to see if boundary condtions have been assigned and if not defaults to no flux boundaries.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::check_file_extensions_and_paths ( )
protected

This check to see if the filenames, paths and extensions have been assigned. If not it changes these to defaults.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::check_pathname_for_slash ( )
protected

this adds a slash to the end of the pathname

Author
SMM
Date
29/07/2014
string LSDAnalysisDriver::check_pathname_for_slash ( string  this_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

Parameters
this_pathnamethe string containing the pathname the string with a slash at the end if it hasn't got one already
Author
SMM
Date
19/09/2014
void LSDAnalysisDriver::check_polyfit ( )
protected

This checks on the polyfit functions needed.

Author
SMM
Date
22/09/2014
void LSDAnalysisDriver::compute_rasters_from_raster_switches ( )

This looks through the raster switches, and calculates the necessary rasters.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::fill_raster ( )

This calculates the fill raster.

Author
SMM
Date
29/07/2014
LSDChannel LSDAnalysisDriver::get_single_thread_channel ( )

This retrieves a single thread channel.

Author
SMM
Date
24/09/2014
string LSDAnalysisDriver::get_string_before_dot ( string  this_string)
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

Parameters
this_stringthe string you want truncated
Returns
the truncated string
Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::ingest_data ( string  pname,
string  p_fname 
)

This is the main function for parsing the parameter file.

Parameters
pathnamethe path to the paramter file
param_fnamethe name of the parameter file
Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::read_base_raster ( )

This simply loads the base raster into the vector of rasters.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::write_rasters_from_analysis_switches ( )

This writes rasters based on the analysis switches.

Author
SMM
Date
29/07/2014
void LSDAnalysisDriver::write_shapes_from_switches ( )

This writes other forms of data based on the analysis switches.

Author
SMM
Date
29/07/2014

Member Data Documentation

map<string,float> LSDAnalysisDriver::float_parameters
protected

This is a map that tell where the indices into the raster vecs are.

This holds float parameters

bool LSDAnalysisDriver::got_JunctionNetwork
protected

Pointer to junction network object.

tells the code if you've got the junction network

map<string,string> LSDAnalysisDriver::method_map
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

map<string,bool> LSDAnalysisDriver::raster_switches
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

map<string,string> LSDAnalysisDriver::support_file_names
protected

This holds names of supporting files, for example files that contain node of junction indices to be loaded.


The documentation for this class was generated from the following files: