tilupy.initdata
Functions
|
Generates a synthetic topography and initial mass, saves them as ASCII files, |
|
Create Gray99 topographic and mass test. |
Module Contents
Functions
- tilupy.initdata.create_topo_constant_slope(folder_out: str, xmax: int = 30, ymax: int = 25, cell_size: float = 0.5, theta: int = 5, mass_type: str = 'r', r_center: tuple = (7.5, 12.5), r_radius: tuple = (3.75, 3.75), s_vertex: list = [0, 5, 0, 25], h_max: float = 3.75, description: str = 'No informations.') list[str, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
Generates a synthetic topography and initial mass, saves them as ASCII files, and stores all configuration parameters in a dedicated folder.
- Parameters:
folder_out (str) – Output folder.
xmax (int) – Domain length in the X direction (in meters).
ymax (int) – Domain length in the Y direction (in meters).
cell_size (float) – Spatial resolution of the grid (in meters).
theta (int) – Slope angle of the topography (in degrees).
mass_type (str) – Shape of the initial mass: ‘r’ for ellipse, ‘s’ for rectangle.
r_center (tuple) – Center (x, y) of the elliptical initial mass.
r_radius (tuple) – Radii (rx, ry) of the elliptical initial mass.
s_vertex (list) – Rectangle boundaries [xmin, xmax, ymin, ymax] for the rectangular mass.
h_max (float) – Maximum height of the initial mass.
description (str) – Text description of the configuration.
- Returns:
- folder_pathstr
Absolute path to the output directory.
- x, ynumpy.ndarray, numpy.ndarray
Meshgrid coordinates.
- znumpy.ndarray
Topography data.
- mnumpy.ndarray
Initial mass distribution.
- Return type:
list[str, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
- tilupy.initdata.gray99_topo_mass(dx: float = 0.1, dy: float = 0.1, res_type: str = 'true_normal') list[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
Create Gray99 topographic and mass test.
Create an initial spherical calotte above the topography, resulting as a mass with a height of 0.22 m and a radius of 0.32 m (more precisely it is the length in the downslope direction), following the indications in Gray et al 99 (p. 1859). The correspondig radius of the sphere, and the offset from the topography in the topography normal direction (norm_offset) are deduced from these parameters.
See also Gig 3 in Wieland, Gray and Hutter (1999)
- Parameters:
dx (float, optional) – Cell size of the x axis, by default 0.1
dy (float, optional) – Cell size of the y axis, by default 0.1
res_type (str, optional) –
Type of thickness output:
’true_normal’: Real thickness in the direction normal to the topography.
’vertical’: Thickness in the vertical direction.
’projected_normal’: Thickness normal to the topography is computed from the vertical thickness projected on the axe normal to the topography.
The default is ‘true_normal’.
- Returns:
- Xnumpy.ndarray
Mesh of X coordinates in the cartesian frame (nx*ny).
- Ynumpy.ndarray
Mesh of Y coordinates in the cartesian frame (nx*ny).
- Znumpy.ndarray
Mesh of Z coordinates in the cartesian frame (nx*ny).
- Mnumpy.ndarray
Array of mass height, in the direction normal to topography.
- Return type:
list[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]