tilupy.models.ravaflow.initsimus
Created on Wed May 26 11:03:56 2021
@author: peruzzetto
Attributes
Functions
|
Read a README.txt file and convert it to a parameters dictionary. |
|
Convert a parameters dictionary to a formatted string for RavaFlow input. |
|
Write ravaflow initial file for simple slope test case |
Module Contents
Attributes
- tilupy.models.ravaflow.initsimus.readme_param_match
Functions
- tilupy.models.ravaflow.initsimus.readme_to_params(folder_data: str) dict
Read a README.txt file and convert it to a parameters dictionary.
Each line of the README file should contain a key and a value separated by whitespace. The function parses the file and returns a dictionary mapping keys to their corresponding string values.
- Parameters:
folder_data (str) – Path to the folder containing the README.txt file.
- Returns:
Dictionary where keys are parameter names (str) and values are their corresponding values (str) read from the file.
- Return type:
dict
- tilupy.models.ravaflow.initsimus.write_params(params: dict) str
Convert a parameters dictionary to a formatted string for RavaFlow input.
Generates a single string in the form “key1=val1 key2=val2 …”, suitable for passing as command-line arguments to RavaFlow.
- Parameters:
params (dict) – Dictionary of parameters, where keys and values are strings.
- Returns:
Formatted string containing all parameters in “key=value” format, separated by spaces.
- Return type:
str
- tilupy.models.ravaflow.initsimus.make_simus(law: str, rheol_params: dict, folder_files: str, folder_out: str, readme_file: str) None
Write ravaflow initial file for simple slope test case
Reads simulation parameters from a README file and input ASCII rasters, sets topography and mass, prepares numerical and rheological parameters, and generates a shell script to execute simulations. Supports multiple combinations of rheology parameters.
- Parameters:
law (str) – Rheological law to use, e.g., “coulomb” or “voellmy”.
rheol_params (dict of list) – Dictionary of rheology parameters, each key maps to a list of values defining multiple simulation runs.
folder_files (str) – Path to folder containing input ASCII files “topo.asc” and “mass.asc”.
folder_out (str) – Path to the folder where output simulation folders and run scripts will be created.
readme_file (str) – Path to the README.txt file containing simulation metadata and parameters.
- Return type:
None