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

Public Member Functions

 LSDCosmoData ()
 the default constructor. This doesn't do anything.
 
 LSDCosmoData (string path, string file_prefix)
 This constructor requires a filename The file format is: sample_name nuclide latitude longitude concentration uncertainty standard the sample name cannot have a space the nuclide name must be Be10 or Al26 lat and long are in decimal degrees concetration is in atoms per gram uncertainty is the AMS error in atoms per gram standard is the laboratory standardisation. The options can be found in the code of this function; the numbers come from Balco et al's (2009) CRONUS calculator. More...
 
void initiate_default_parameters ()
 This initiates some default parameters These parameters will be overwritten by any parameters supplied by the parameter file. More...
 
void load_cosmogenic_data (string filename, string filetype)
 THis function loads the crn data rom either a csv or text file. More...
 
void load_DEM_and_shielding_filenames_csv (string filename)
 This function load a csv file containing names of DEMs and (possibly) sheilding rasters or shielding parameters The file should have one DEM name per row. Each row can have between 1 and 4 elements. The elements are: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name If elements are missing, they are considered null arguments. More...
 
void load_parameters (string filename)
 This loads parameters for the comsogenic calculations it uses the parse_files frinction in LSDStatsTools, so the format is the paramterer name, followed by ":", followed by a space and then the parameter value. More...
 
void load_soil_info (string filename)
 This loads information about any soil samples The file contains several columns: sampleID,sample_top_depth,sample_bottom_depth,density The file prefix needs to be the same as the other files, and should have the extension _CRNSoilInfo.csv The top depths and sample thicknesses need to be in cm The densities need to be in kg/m^3. More...
 
void check_files (string crn_fname, string Rasters_fname, string parameters_fname, string soil_fname)
 This checks on the filenames to see if the files exist. More...
 
vector< string > get_DEM_fnames ()
 this gets the names of the DEMs to be used in the analysis only returns the DEM, not snow shielding, topo shielding, etc rasters More...
 
vector< string > get_Snow_fnames ()
 this gets the names of the snow shielding rasters More...
 
vector< string > get_Self_fnames ()
 this gets the names of the self shielding rasters More...
 
void check_parameter_values ()
 This function checks to make sure parameter values are valid for the cosmo data. More...
 
void check_rasters ()
 this function checks the existence and georeferencing of the rasters outlined in the file list More...
 
vector< string > spawn_clipped_basins (string DEM_fname, int basin_padding_px)
 
void BasinSpawnerMaster (string path, string prefix, int padding_pixels)
 This dirves the spawning of basins. More...
 
void RunShielding (string path, string prefix)
 This calculates topographic shielding for basins listed in the _CRNRasters.csv file Shielding rasters are printed to the same folder as the DEM. More...
 
LSDRaster calculate_production_raster (LSDRaster &Elevation_Data, string path_to_atmospheric_data)
 This function calculates and then returns a production raster. More...
 
void convert_to_UTM (int UTM_zone)
 this function calculates the UTM coordinates of all the sample points for a given UTM zone. More...
 
void convert_to_UTM (LSDRaster &Raster)
 this function calculates the UTM coordinates of all the sample points for a given UTM zone. It determines the UTM zone from a raster More...
 
void basic_cosmogenic_analysis (string DEM_prefix)
 This function calculates the CRN erosion rate from the data stored within the data elements of the object This analysis does not calculate snow shielding or landsliding. More...
 
void full_shielding_cosmogenic_analysis (vector< string > Raster_names, vector< double > CRN_params)
 This function computes erosion rates and uncertainties for a given DEM. It is wrapped by a function that goes through the list of DEM, providing this function with the raster names and the parameters for the model run. More...
 
void full_shielding_cosmogenic_analysis_nested (vector< string > Raster_names, vector< double > CRN_params, LSDRaster &known_eff_erosion)
 This function computes erosion rates and uncertainties for a given DEM. It is wrapped by a function that goes through the list of DEM, providing this function with the raster names and the parameters for the model run . This version can take a raster with known erosion rates that can be used for nesting of basins. More...
 
void full_shielding_cosmogenic_analysis_for_spawned (vector< string > Raster_names, vector< double > CRN_params)
 This function computes erosion rates and uncertainties for a given DEM. It is wrapped by a function that goes through the list of DEM, providing this function with the raster names and the parameters for the model run. This version is for spawned rasters Because this is spawned, each raster only corresponds to one sample, which the function finds from the sample name corresponding to the last string in the raster name after the _ character. More...
 
void Soil_sample_calculator (vector< string > Raster_names, vector< double > CRN_params)
 This function computes erosion rates and uncertainties for a given det of soil data,. More...
 
vector< double > full_CRN_erosion_analysis_point (double Nuclide_conc, string Nuclide, double Nuclide_conc_err, double prod_uncert_factor, string Muon_scaling, double snow_eff_depth, double self_eff_depth, double topo_shield, double production)
 This function wraps the erosion rate calculator, and returns both the erosion rate as well as the uncertainties. More...
 
double predict_CRN_erosion_point (double Nuclide_conc, string Nuclide, double prod_uncert_factor, string Muon_scaling, double &production_uncertainty, double &average_production, bool is_production_uncertainty_plus_on, bool is_production_uncertainty_minus_on, double snow_eff_depth, double self_eff_depth, double topo_shield, double production)
 this uses Newton Raphson iteration to retrieve the erosion rate from a basin given a nuclide concentration More...
 
double predict_mean_CRN_conc_point (double eff_erosion_rate, string Nuclide, double prod_uncert_factor, string Muon_scaling, double &production_uncertainty, bool is_production_uncertainty_plus_on, bool is_production_uncertainty_minus_on, double snow_eff_depth, double self_eff_depth, double topo_shield, double production)
 this predicts the mean concentration of a nuclide for a point location. It does a full analyitical solution to account for snow and self sheilding More...
 
void calculate_erosion_rates (int method_flag)
 This function wraps the cosmogenic rate calculators. Looks throught the vecvecs listing file locations and then finds valid CRN data, and runs the erosion rate routine for these data. More...
 
void calculate_nested_erosion_rates ()
 This function wraps the cosmogenic rate calculators. THis one is used with nested basins. Looks throught the vecvecs listing file locations and then finds valid CRN data, and runs the erosion rate routine for these data. It assumes that any known erosion rates will have the same name as the base DEM with the extension _ERKnown. More...
 
void full_shielding_raster_printer (vector< string > Raster_names, vector< double > CRN_params)
 This function prints sevear rasters to file: 1) Pixel-by-pixel production scaling 2) Pixel-by-pixel combined scaling (production plus combined shielding) 3) Pixel-by-pixel combined shielding 4) The cosmo concetration coming from each pixel at the proscribed erosion rate. More...
 
void point_measurements (vector< int > valid_samples, vector< double > snow_thickness, vector< double > self_thickness, vector< double > toposhield, vector< double > production_scaling, string muon_scaling)
 This function uses the COSMOCALC functions of LSDParticles to calculate the erosion rates from point measurements using pre-calculated vectors of shielding and scaling data. More...
 
void full_shielding_CRN_concentration_predictor (vector< string > Raster_names, vector< double > CRN_params, LSDRaster &known_eff_erosion)
 This function calculates the concentration of a CRN (either 10Be or 26Al) given an erosion rate supplied by and erosion rate raster (in g/cm^2/yr) More...
 
void print_data_to_screen ()
 this function prints the data held in the the data members to screen. Is used for bug checking. Note the function does not print the standardised values, only raw values. More...
 
void print_renamed_cosmo_data (string path, string prefix)
 This prints the cosmo data to a new file. More...
 
void print_renamed_parameter_data (string path, string prefix)
 This prints the parameter data to a new file. More...
 
void print_file_structures_to_screen ()
 this prints the file structure data to screen it is a list of the DEMs, snow shielding rasters, self shelding rasters and topo shielding rasters used in the analysis the later three rasters can be NULL values, and the snow and self shielding rasters can be replaced by single values More...
 
void print_all_data_parameters_and_filestructures (string outfilename)
 this prints all the data, parameters and file structures to screen It is used to keep a record of CRN erosion rate computations so analyses can be reproduced More...
 
void print_simple_results_to_screen (double rho)
 Prints the simple results to the screen The 'simple' is because it only looks at external, muon, and production uncertainties. More...
 
void print_results ()
 This prints the results to a csv file and to a file for passing to CRONUS The columns in the CSV file are: sample_name nuclide latitude longitude concentration (atms/g) concentration_uncert (atoms/g) erosion rate g_percm2_peryr erosion rate AMS_uncert g_percm2_peryr muon_uncert g_percm2_peryr production_uncert g_percm2_peryr total_uncert g_percm2_peryr AvgProdScaling dimensionless AverageTopoShielding dimensionless AverageSelfShielding dimensionless AverageSnowShielding dimensionless AverageCombinedScaling dimensionless (this is averaged production scaling times toposhielding) outlet_latitude OutletPressure hPa OutletEffPressure hPa (pressure needed to get basin averaged production scaling) centroid_latitude CentroidPressure hPa CentroidEffPressure (pressure needed to get basin averaged production scaling) ErosionRate_in_cmperkyr (to check against cosmocalc, assumes 2650 kg/m^2) ErosionRate_COSMOCALC_in_g_percm2_peryr (assumes 2650 kg/m^2): The erosion rate you would get if you took production weighted scaling and used cosmocalc. ErosionRate_COSMOCALC_cmperkyr (assumes 2650 kg/m^2): The erosion rate you would get if you took production weighted scaling and used cosmocalc. More...
 
void print_rasters ()
 This function prints several rasters to file: 1) Pixel-by-pixel production scaling 2) Pixel-by-pixel combined scaling (production plus combined shielding) 3) Pixel-by-pixel combined shielding 4) The cosmo concetration coming from each pixel at the proscribed erosion rate. More...
 
void print_scaling_and_shielding_complete_rasters ()
 This prints scaling, shielding production and other rasters for entire DEMs. It only prints topo, snow and self shielding if those rasters exists. That is, it does not calculate toposhielding automatically. The printed rasters are: extension _PRES the atmospheric pressure in hPa, determined from the NCEP atmospheric pressure compilation following Balco et al 2008 extension _PROD the production scaling, based on stone/lal extension _CSHIELD the combined sheilding, that is the combination of snow, self and topographic shielding. Snow and self shielding are approximated with spallation only production extension _CSCALE the product of the combined shielding and production for each pixel. More...
 
void print_basins_to_for_checking ()
 This prints the basins to a raster, along with the stream order raster so that users can check if their basins are in the correct place THis prints out a raster for each raster supplied in the CRNRaster data file that contains the basins, a file with a key to the basins, and a stream order raster to help in refining the location of the data. More...
 

Protected Attributes

int N_samples
 the number of samples
 
string path
 the path to the cosmo data. Also used to print results
 
string param_name
 the prefix of the parameter files
 
vector< string > sample_name
 A vector of the sample names.
 
vector< int > soil_sample_index
 A vector with the indices into the valid samples that have soil data.
 
vector< int > has_soil_data_index
 
vector< double > soil_top_effective_depth
 
vector< double > soil_effective_thickness
 
vector< double > latitude
 a vector holding the latitude of the samples
 
vector< double > longitude
 a vector holding the longitude of the samples
 
vector< double > UTM_easting
 a vector holding the UTM of the samples
 
vector< double > UTM_northing
 a vector holding the UTM northing of the samples
 
vector< string > nuclide
 the nuclide. Only options are Be10 and 26Al.
 
vector< string > standardisation
 a string holding the standardisation
 
vector< double > Concentration
 a vector holding the concetration, in atoms per gram, of the sample
 
vector< double > Concentration_uncertainty
 a vector holding the AMS uncertainty of the sample, in atoms per gram
 
vector< double > Concentration_unstandardised
 
vector< double > Concentration_uncertainty_unstandardised
 
vector< vector< double > > erosion_rate_results
 a vector of vectors holding the results of the cosmogenic analysis
 
map< string, double > standards_Be10
 a standardisation map for Be10
 
map< string, double > standards_Al26
 a standardisation map for Al26
 
vector< vector< string > > DEM_names_vecvec
 
vector< vector< double > > snow_self_topo_shielding_params
 
float min_slope
 The minimum slope for the fill function.
 
int source_threshold
 The number of pixels for a channel.
 
int search_radius_nodes
 The number of pixels over which to search for a channel.
 
int threshold_stream_order
 The minimum stream order to be considered a channel for cosmo sampling.
 
int theta_step
 The azimuth step for topographic shielding calculations.
 
int phi_step
 The inclination step for topographic sheilding calculations.
 
double prod_uncert_factor
 
string Muon_scaling
 The muon production scaling. Options are "Braucher", "Granger" and "Schaller".
 
string path_to_atmospheric_data
 
vector< string > boundary_conditions
 The boundary conditions for the flow info object.
 
bool write_TopoShield_raster
 Write toposheild rasters if they don't exist.
 
bool write_basin_index_raster
 Write a LSDIndexRaster with the basins.
 
bool write_full_scaling_rasters
 Write the shielding and scaling rasters.
 
map< string, map< int, double > > MapOfProdAndScaling
 
vector< double > MBS
 The Basin Relief.
 

Constructor & Destructor Documentation

LSDCosmoData::LSDCosmoData ( string  path,
string  file_prefix 
)
inline

This constructor requires a filename The file format is: sample_name nuclide latitude longitude concentration uncertainty standard the sample name cannot have a space the nuclide name must be Be10 or Al26 lat and long are in decimal degrees concetration is in atoms per gram uncertainty is the AMS error in atoms per gram standard is the laboratory standardisation. The options can be found in the code of this function; the numbers come from Balco et al's (2009) CRONUS calculator.

Parameters
filenamethe string of the file within which the cosmo data is stored. This INCLUDES PATH AND EXTENSION.
ftypethe type of file, options are csv and txt. If not one of these options the code assumes txt
Author
SMM
Date
06/02/2015

Member Function Documentation

void LSDCosmoData::basic_cosmogenic_analysis ( string  DEM_prefix)

This function calculates the CRN erosion rate from the data stored within the data elements of the object This analysis does not calculate snow shielding or landsliding.

Parameters
DEM_prefixa string holding the prefix of the DEM (without the bil) NOTE the DEM must be in bil format.
Author
SMM
Date
09/02/2015
void LSDCosmoData::BasinSpawnerMaster ( string  path,
string  prefix,
int  padding_pixels 
)

This dirves the spawning of basins.

Parameters
pathThis is a string containing the path to the data files (needs / at the end)
prefixthe prefix of the data files
padding_pixelsthe number of pixels with which to pad the basins
Author
SMM
Date
10/07/2015
void LSDCosmoData::calculate_erosion_rates ( int  method_flag)

This function wraps the cosmogenic rate calculators. Looks throught the vecvecs listing file locations and then finds valid CRN data, and runs the erosion rate routine for these data.

Parameters
method_flagan int that sets the method default: use snow and self shielding method_flag == 0, basic analysis (snow and self set to 0, calculate toposhield) method_flag == 1, snow and self sheilding, can load toposhield if provided
Author
SMM
Date
28/02/2015
void LSDCosmoData::calculate_nested_erosion_rates ( )

This function wraps the cosmogenic rate calculators. THis one is used with nested basins. Looks throught the vecvecs listing file locations and then finds valid CRN data, and runs the erosion rate routine for these data. It assumes that any known erosion rates will have the same name as the base DEM with the extension _ERKnown.

Author
SMM
Date
23/02/2016
LSDRaster LSDCosmoData::calculate_production_raster ( LSDRaster Elevation_Data,
string  path_to_atmospheric_data 
)

This function calculates and then returns a production raster.

Parameters
Elevation_dataa raster holding the elevations
path_to_atmospheric_dataa string that holds the path of the atmospheric data
Author
SMM
Date
28/01/2016
void LSDCosmoData::check_files ( string  crn_fname,
string  Rasters_fname,
string  parameters_fname,
string  soil_fname 
)

This checks on the filenames to see if the files exist.

Parameters
crn_fnamea string with the name (including path) of the CRN file
Rasters_fnamea string with the name (including path) of the Rasters file
parameters_fnamea string with the name (including path) of the parameters file
soil_fnamea string with the name (including path) of the soil file
Author
SMM
Date
14/02/2016
void LSDCosmoData::check_parameter_values ( )

This function checks to make sure parameter values are valid for the cosmo data.

Author
SMM
Date
03/03/2015
void LSDCosmoData::check_rasters ( )

this function checks the existence and georeferencing of the rasters outlined in the file list

Author
SMM
Date
03/03/2015
void LSDCosmoData::convert_to_UTM ( int  UTM_zone)

this function calculates the UTM coordinates of all the sample points for a given UTM zone.

Parameters
UTM_zonethe UTM zone
Author
SMM
Date
06/02/2015
void LSDCosmoData::convert_to_UTM ( LSDRaster Raster)

this function calculates the UTM coordinates of all the sample points for a given UTM zone. It determines the UTM zone from a raster

Parameters
Rasterthe LSDRaster from which the UTM zone is determined
Author
SMM
Date
06/02/2015
vector< double > LSDCosmoData::full_CRN_erosion_analysis_point ( double  Nuclide_conc,
string  Nuclide,
double  Nuclide_conc_err,
double  prod_uncert_factor,
string  Muon_scaling,
double  snow_eff_depth,
double  self_eff_depth,
double  topo_shield,
double  production 
)

This function wraps the erosion rate calculator, and returns both the erosion rate as well as the uncertainties.

Parameters
Nuclide_concConcetration of the nuclide
Nuclidea string denoting the name of the nuclide (at the moment options are 10Be and 26Al)
Nuclide_conc_errThe instrument error in the nuclide concentration
prod_uncert_fractonThis is a fraction of the total uncertainty for the production rates. It is a lumped parameter that can be used for just production, or for snow, topo and porduction uncertainty
Muon_scalingstring that gives the muon scaling scheme options are Schaller, Granger and Braucher
snow_eff_depththe effective depth (in g/cm^2) of snow
self_eff_depththe effective depth (in g/cm^2) of self shielding
topo_shieldthe topographic shielding at this point
productionthe production rate of the nuclude at this point
Returns
a vector of both the erosion rates and the uncertainties of the sample
Author
SMM
Date
24/01/2016
void LSDCosmoData::full_shielding_cosmogenic_analysis ( vector< string >  Raster_names,
vector< double >  CRN_params 
)

This function computes erosion rates and uncertainties for a given DEM. It is wrapped by a function that goes through the list of DEM, providing this function with the raster names and the parameters for the model run.

Parameters
Raster_namesa vector of strings with 4 elements: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name It there is no DEM then this is set to "NULL"
CRN_paramsthis contains the single shielding depths for snow and self shielding if the rasters are not supplied.
Author
SMM
Date
28/02/2015
void LSDCosmoData::full_shielding_cosmogenic_analysis_for_spawned ( vector< string >  Raster_names,
vector< double >  CRN_params 
)

This function computes erosion rates and uncertainties for a given DEM. It is wrapped by a function that goes through the list of DEM, providing this function with the raster names and the parameters for the model run. This version is for spawned rasters Because this is spawned, each raster only corresponds to one sample, which the function finds from the sample name corresponding to the last string in the raster name after the _ character.

Parameters
Raster_namesa vector of strings with 4 elements: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name It there is no DEM then this is set to "NULL"
CRN_paramsthis contains the single shielding depths for snow and self shielding if the rasters are not supplied.
Author
SMM
Date
30/01/2016
void LSDCosmoData::full_shielding_cosmogenic_analysis_nested ( vector< string >  Raster_names,
vector< double >  CRN_params,
LSDRaster known_eff_erosion 
)

This function computes erosion rates and uncertainties for a given DEM. It is wrapped by a function that goes through the list of DEM, providing this function with the raster names and the parameters for the model run . This version can take a raster with known erosion rates that can be used for nesting of basins.

Parameters
Raster_namesa vector of strings with 4 elements: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name It there is no DEM then this is set to "NULL"
CRN_paramsthis contains the single shielding depths for snow and self shielding if the rasters are not supplied.
known_eff_erosionan LSDRaster with known erosion rates in g/cm^2/yr
Author
SMM
Date
12/02/2016
void LSDCosmoData::full_shielding_CRN_concentration_predictor ( vector< string >  Raster_names,
vector< double >  CRN_params,
LSDRaster known_eff_erosion 
)

This function calculates the concentration of a CRN (either 10Be or 26Al) given an erosion rate supplied by and erosion rate raster (in g/cm^2/yr)

Parameters
Raster_namesa vector of strings with 4 elements: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name It there is no DEM then this is set to "NULL"
CRN_paramsthis contains the single shielding depths for snow and self shielding if the rasters are not supplied.
known_eff_erosionan LSDRaster with known erosion rates in g/cm^2/yr
Author
SMM
Date
14/06/2016
void LSDCosmoData::full_shielding_raster_printer ( vector< string >  Raster_names,
vector< double >  CRN_params 
)

This function prints sevear rasters to file: 1) Pixel-by-pixel production scaling 2) Pixel-by-pixel combined scaling (production plus combined shielding) 3) Pixel-by-pixel combined shielding 4) The cosmo concetration coming from each pixel at the proscribed erosion rate.

Parameters
Raster_namesa vector containing the names of DEM, snow, self and toposhield rasters
CRN_paramsa vector of parameter values
Author
SMM
Date
23/03/2015
vector< string > LSDCosmoData::get_DEM_fnames ( )

this gets the names of the DEMs to be used in the analysis only returns the DEM, not snow shielding, topo shielding, etc rasters

Returns
DEM_fnames a vector of fname strings
Author
SMM
Date
19/03/2015
vector< string > LSDCosmoData::get_Self_fnames ( )

this gets the names of the self shielding rasters

returns only snow shielding names. If name does not exist, returns NULL.

Returns
Self_fnames a vector of fname strings
Author
SMM
Date
07/07/2015
vector< string > LSDCosmoData::get_Snow_fnames ( )

this gets the names of the snow shielding rasters

returns only snow shielding names. If name does not exist, returns NULL.

Returns
Snow_fnames a vector of fname strings
Author
SMM
Date
07/07/2015
void LSDCosmoData::initiate_default_parameters ( )

This initiates some default parameters These parameters will be overwritten by any parameters supplied by the parameter file.

Author
SMM
Date
14/02/2016
void LSDCosmoData::load_cosmogenic_data ( string  filename,
string  filetype 
)

THis function loads the crn data rom either a csv or text file.

Parameters
filenamethe name of the file
filetypethis is either csv or txt
Author
SMM
Date
26/02/2015
void LSDCosmoData::load_DEM_and_shielding_filenames_csv ( string  filename)

This function load a csv file containing names of DEMs and (possibly) sheilding rasters or shielding parameters The file should have one DEM name per row. Each row can have between 1 and 4 elements. The elements are: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name If elements are missing, they are considered null arguments.

Parameters
filenamethe name of the csv file
Author
SMM
Date
26/02/2015
void LSDCosmoData::load_parameters ( string  filename)

This loads parameters for the comsogenic calculations it uses the parse_files frinction in LSDStatsTools, so the format is the paramterer name, followed by ":", followed by a space and then the parameter value.

Parameters
filenamea string of the full filename
Author
SMM
Date
02/02/2016
void LSDCosmoData::load_soil_info ( string  filename)

This loads information about any soil samples The file contains several columns: sampleID,sample_top_depth,sample_bottom_depth,density The file prefix needs to be the same as the other files, and should have the extension _CRNSoilInfo.csv The top depths and sample thicknesses need to be in cm The densities need to be in kg/m^3.

Parameters
filenamea string of the full filename
Author
SMM
Date
02/03/2015
void LSDCosmoData::point_measurements ( vector< int >  valid_samples,
vector< double >  snow_thickness,
vector< double >  self_thickness,
vector< double >  toposhield,
vector< double >  production_scaling,
string  muon_scaling 
)

This function uses the COSMOCALC functions of LSDParticles to calculate the erosion rates from point measurements using pre-calculated vectors of shielding and scaling data.

Parameters
valid_samplesa vector continaing the indices into the samples you want to use
snow_thicknessa vector of snow thickness in g/cm^2 (or any surface shielding) that is the same size as valid_samples
self_thicknessthe self thickness in g/cm^2. For soil samples this can be the thickness of the sample. Same size as valid_samples
toposhielda vecor with the local topographic shielding
production_scalinga vector with the production scaling
muon_scalinga string with a valid scaling scheme name
Author
SMM
Date
29/01/2016
double LSDCosmoData::predict_CRN_erosion_point ( double  Nuclide_conc,
string  Nuclide,
double  prod_uncert_factor,
string  Muon_scaling,
double &  production_uncertainty,
double &  average_production,
bool  is_production_uncertainty_plus_on,
bool  is_production_uncertainty_minus_on,
double  snow_eff_depth,
double  self_eff_depth,
double  topo_shield,
double  production 
)

this uses Newton Raphson iteration to retrieve the erosion rate from a basin given a nuclide concentration

Parameters
eff_erosionrate The erosion rate in g/cm^2/yr
Nuclidea string with the nuclide name. At the moment the options are: Be10 Al26 These are case sensitive
prod_uncert_factorproduction uncertainty factor is a multiplier that sets the production certainty. If it is 1.1, there is 10% production rate uncertainty, or if it is 0.9 there is -10% unvertainty. The reason why it is implemented like this is that this allows gaussian error propigation.
Muon_scalinga string that gives the muon scaling scheme. options are Schaller, Braucher and Granger
production_uncertaintythis gives the uncertainty in the production rates based on the production_uncert_factor; it is used in gaussian error propigation. The parameter is replaced within the function.
average_productionThis gives the production rate average for the basin. It can be used for uncertainty analyis: if the scaling is changed the change in this production rate can be used to construct the gaussian error propigation terms
is_production_uncertainty_plus_ona boolean that is true if the production rate uncertainty (+) is switched on
is_production_uncertainty_minus_ona boolean that is true if the production rate uncertainty (-) is switched on. If the + switch is true this parameter defauts to false.
Returns
The effective erosion rate in g/cm^-2/yr
Author
SMM
Date
24/01/2016
double LSDCosmoData::predict_mean_CRN_conc_point ( double  eff_erosion_rate,
string  Nuclide,
double  prod_uncert_factor,
string  Muon_scaling,
double &  production_uncertainty,
bool  is_production_uncertainty_plus_on,
bool  is_production_uncertainty_minus_on,
double  snow_eff_depth,
double  self_eff_depth,
double  topo_shield,
double  production 
)

this predicts the mean concentration of a nuclide for a point location. It does a full analyitical solution to account for snow and self sheilding

Parameters
eff_erosionrate The erosion rate in g/cm^2/yr
Nuclidea string with the nuclide name. At the moment the options are: Be10 Al26 These are case sensitive
prod_uncert_factorproduction uncertainty factor is a multiplier that sets the production certainty. If it is 1.1, there is 10% production rate uncertainty, or if it is 0.9 there is -10% unvertainty. The reason why it is implemented like this is that this allows gaussian error propigation.
Muon_scalinga string that gives the muon scaling scheme. options are Schaller, Braucher and Granger
data_from_outlet_onlyboolean that is true of you want concentration calculated from the outlet only.
production_uncertaintythis gives the uncertainty in the production rates based on the production_uncert_factor; it is used in gaussian error propigation. The parameter is replaced within the function.
is_production_uncertainty_plus_ona boolean that is true if the production rate uncertainty (+) is switched on
is_production_uncertainty_minus_ona boolean that is true if the production rate uncertainty (-) is switched on. If the + switch is true this parameter defauts to false.
snow_eff_depththe effective depth (in g/cm^2) of snow
self_eff_depththe effective depth (in g/cm^2) of self shielding
topo_shieldthe topographic shielding at this point
productionthe production rate of the nuclude at this point
Returns
the concentration of the nuclide averaged across the DEM
Author
SMM
Date
24/01/2016
void LSDCosmoData::print_all_data_parameters_and_filestructures ( string  outfilename)

this prints all the data, parameters and file structures to screen It is used to keep a record of CRN erosion rate computations so analyses can be reproduced

Parameters
outfilenamethe name of the outfile including full path
Author
SMM
Date
02/03/2015
void LSDCosmoData::print_basins_to_for_checking ( )

This prints the basins to a raster, along with the stream order raster so that users can check if their basins are in the correct place THis prints out a raster for each raster supplied in the CRNRaster data file that contains the basins, a file with a key to the basins, and a stream order raster to help in refining the location of the data.

Author
SMM
Date
11/04/2016
void LSDCosmoData::print_data_to_screen ( )

this function prints the data held in the the data members to screen. Is used for bug checking. Note the function does not print the standardised values, only raw values.

Author
SMM
Date
09/02/2015
void LSDCosmoData::print_file_structures_to_screen ( )

this prints the file structure data to screen it is a list of the DEMs, snow shielding rasters, self shelding rasters and topo shielding rasters used in the analysis the later three rasters can be NULL values, and the snow and self shielding rasters can be replaced by single values

Author
SMM
Date
26/02/2015
void LSDCosmoData::print_rasters ( )

This function prints several rasters to file: 1) Pixel-by-pixel production scaling 2) Pixel-by-pixel combined scaling (production plus combined shielding) 3) Pixel-by-pixel combined shielding 4) The cosmo concetration coming from each pixel at the proscribed erosion rate.

Author
SMM
Date
23/03/2015
void LSDCosmoData::print_renamed_cosmo_data ( string  path,
string  prefix 
)

This prints the cosmo data to a new file.

Parameters
pathis the pathname. Needs a "/" at the end
prefixthe name of the file before _CRNData.csv
Author
SMM
Date
14/07/2015
void LSDCosmoData::print_renamed_parameter_data ( string  path,
string  prefix 
)

This prints the parameter data to a new file.

Parameters
pathis the pathname. Needs a "/" at the end
prefixthe name of the file before _CRNData.csv
Author
SMM
Date
14/07/2015
void LSDCosmoData::print_results ( )

This prints the results to a csv file and to a file for passing to CRONUS The columns in the CSV file are: sample_name nuclide latitude longitude concentration (atms/g) concentration_uncert (atoms/g) erosion rate g_percm2_peryr erosion rate AMS_uncert g_percm2_peryr muon_uncert g_percm2_peryr production_uncert g_percm2_peryr total_uncert g_percm2_peryr AvgProdScaling dimensionless AverageTopoShielding dimensionless AverageSelfShielding dimensionless AverageSnowShielding dimensionless AverageCombinedScaling dimensionless (this is averaged production scaling times toposhielding) outlet_latitude OutletPressure hPa OutletEffPressure hPa (pressure needed to get basin averaged production scaling) centroid_latitude CentroidPressure hPa CentroidEffPressure (pressure needed to get basin averaged production scaling) ErosionRate_in_cmperkyr (to check against cosmocalc, assumes 2650 kg/m^2) ErosionRate_COSMOCALC_in_g_percm2_peryr (assumes 2650 kg/m^2): The erosion rate you would get if you took production weighted scaling and used cosmocalc. ErosionRate_COSMOCALC_cmperkyr (assumes 2650 kg/m^2): The erosion rate you would get if you took production weighted scaling and used cosmocalc.

Author
SMM
Date
12/03/2015
void LSDCosmoData::print_scaling_and_shielding_complete_rasters ( )

This prints scaling, shielding production and other rasters for entire DEMs. It only prints topo, snow and self shielding if those rasters exists. That is, it does not calculate toposhielding automatically. The printed rasters are: extension _PRES the atmospheric pressure in hPa, determined from the NCEP atmospheric pressure compilation following Balco et al 2008 extension _PROD the production scaling, based on stone/lal extension _CSHIELD the combined sheilding, that is the combination of snow, self and topographic shielding. Snow and self shielding are approximated with spallation only production extension _CSCALE the product of the combined shielding and production for each pixel.

Author
SMM
Date
15/02/2016
void LSDCosmoData::print_simple_results_to_screen ( double  rho)

Prints the simple results to the screen The 'simple' is because it only looks at external, muon, and production uncertainties.

Parameters
rhothe rock denisty in kg/m^3
Author
SMM
Date
10/02/2015
void LSDCosmoData::RunShielding ( string  path,
string  prefix 
)

This calculates topographic shielding for basins listed in the _CRNRasters.csv file Shielding rasters are printed to the same folder as the DEM.

Parameters
pathThis is a string containing the path to the data files (needs / at the end)
prefixthe prefix of the data files
Author
SMM
Date
15/07/2015
void LSDCosmoData::Soil_sample_calculator ( vector< string >  Raster_names,
vector< double >  CRN_params 
)

This function computes erosion rates and uncertainties for a given det of soil data,.

Parameters
Raster_namesa vector of strings with 4 elements: [0] = DEM_filename [1] = Snow_shield_raster_name OR const_snow_shield in g/cm^2 [2] = Self_shield_raster_name OR const_self_shield in g/cm^2 [3] = Toposhield_raster_name It there is no DEM then this is set to "NULL"
CRN_paramsthis contains the single shielding depths for snow and self shielding if the rasters are not supplied.
Author
SMM
Date
22/01/2016
vector< string > LSDCosmoData::spawn_clipped_basins ( string  DEM_fname,
int  basin_padding_px 
)

This function takes a DEM and then spawns dems that are clipped to the basin boundaries, with padding to incorporate surrounding high topography and CRN samples that might lie outside the basin due to GPS errors

Parameters
DEM_fnamethe name of the DEM with FULL PATH but excluding extension
basin_padding_pxthe number of pixels that should be padded from the basin
Author
SMM
Date
18/03/2015

Member Data Documentation

vector<double> LSDCosmoData::Concentration_uncertainty_unstandardised
protected

a vector holding the AMS uncertainty of the sample, in atoms per gram this is for data before standardisation

vector<double> LSDCosmoData::Concentration_unstandardised
protected

a vector holding the concetration, in atoms per gram, of the sample this is for data before standardisation

vector< vector<string> > LSDCosmoData::DEM_names_vecvec
protected

a string vecvec for holding the DEM names involved in the analysis elements are [0] = DEM name [1] = snow_shield raster [2] = self shield raster [3] = topo shield raster When there is no raster, this is "NULL"

vector<int> LSDCosmoData::has_soil_data_index
protected

this is an index that points from a sample to an entry in the soil vectors

map<string, map<int,double> > LSDCosmoData::MapOfProdAndScaling
protected

This contains data with all sorts of scaling parameters for calculation of erosion rates using other calculators

string LSDCosmoData::path_to_atmospheric_data
protected

the atmospheric data is in the folder with the driver_functions, but can be changed if necessary.

double LSDCosmoData::prod_uncert_factor
protected

an uncertainty parameter which was superceded by the new error analyses but I have been too lazy to remove it. Does nothing

vector< vector<double> > LSDCosmoData::snow_self_topo_shielding_params
protected

A vector holding the parameters for snow and self shielding if it is a single value.

vector<double> LSDCosmoData::soil_effective_thickness
protected

The thickness (in g/cm^2) of a soil sample This vector is indexed into the other vectors with valid_soil_samples

vector<double> LSDCosmoData::soil_top_effective_depth
protected

The top depth (in soil, in g/cm^2) of a soil sample This vector is indexed into the other vectors with valid_soil_samples


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