10. watertable

Module for defining the classes related to the water table of a slope stability problem.

class watertable.WaterTable(slopeCoords, watertabDepths, smoothFactor=0)[source]

Bases: object

Creates an instance of an object that defines the structure of the water table of a slope stability problem.

WaterTable(slopeCoords, watertabDepths, smoothFactor=0)

The water table is defined as tuples of points where the first value is the relative distance from the left most point of the slope and the second one is the relative depth from the terrain surface.

Some rules have to be followed: The distance equal to zero must be introduced; the distance equal to the horizontal length of the terrain surface must be introduced unless the last depth is zero; if the last input depth is equal to zero, the water table will continue with the surface shape.

slopeCoords

Coordinates of the slope which is supossed to be a closed polygon. It can be gotten from the method defineBoundary either from the classes AnthropicSlope or NaturalSlope (both in the module SlopeGeometry), however it works for any polygon.

Type:(2, n) numpy.ndarray
watertabDepths

Relative coordinates to the slope surface of the polyline which defines the watertable. First row contains the horizontal relative distances from the left most point on the terrain surface and the second row contains the depths meassured from the terrain surface.

Type:(2, n) numpy.ndarray
smoothFactor

Value to indicate the B-spline interpolation order of the smooter function. If is equal to zero, which is the default value, the surface will not be smoothed. It is suggested that the smooth factor be equal to 2 or 3 because higher values tend to lower the water table due to the smoothing.

Type:int

Note

The class WaterTable requires numpy, matplotlib and shapely.

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.watertable import WaterTable
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> watertabDepths = array([[0, 2, 5, 7, 12, 15],
>>>                        [2.5, 2.5, 3, 1.5, 0.5, 1]])
>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=1)
>>> watertable.__dict__.keys()
dict_keys(['slopeCoords', 'watertabDepths', 'smoothFactor', 'coords'])
defineStructre()[source]

Method to define the structure of the water table

If the polyline which defines the water table intersects the terrain surface, it will force the water table keeps on the terrain and not above it.

Returns:Absolute coordinates of the vertices of the polyline which defines the water table. First row contains the abcsises and the second row contains the ordinates.
Return type:((2, n) numpy.ndarray)

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.watertable import WaterTable
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> watertabDepths = array([[0, 2, 5, 7, 12, 15],
>>>                        [2.5, 2.5, 3, 1.5, 0.5, 1]])
>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=1)
>>> watertable.defineStructre()
array([[ 0.        ,  0.20408163,  0.40816327,  0.6122449 ,...],
       [ 6.875     ,  6.875     ,  6.875     ,  6.875     ,...]])
plot()[source]

Method for generating a graphic of the water table and the slope.

Returns:object with the matplotlib structure of the plot. You might use it to save the figure for example.
Return type:(matplotlib.figure.Figure)

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.watertable import WaterTable
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> watertabDepths = array([[0, 2, 5, 7, 12, 15],
>>>                        [2.5, 2.5, 3, 1.5, 0.5, 1]])
>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=0)
>>> fig = watertable.plot()
watertable_example1

example script.

>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=3)
>>> watertable.plot()
watertable_example2

example script.

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> from pybimstab.watertable import WaterTable
>>> terrainCoords = array(
>>>     [[-2.49, 0.1, 1.7, 3.89, 5.9, 8.12, 9.87, 13.29, 20.29,
>>>       21.43, 22.28, 23.48, 24.65, 25.17],
>>>      [18.16, 17.88, 17.28, 15.73, 14.31, 13.58, 13, 3.61, 3.61,
>>>       3.32, 2.71, 2.23, 1.21, 0.25]])
>>> slope = NaturalSlope(terrainCoords)
>>> watertabDepths = array([[0, 5, 10, 15, 20, 25, 27.66],
>>>                         [8, 7, 6, 3, 1, 1, 0.5]])
>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=3)
>>> fig = watertable.plot()
watertable_example3

example script.

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> from pybimstab.watertable import WaterTable
>>> terrainCoords = array(
>>>     [[-2.49, 0.1, 1.7, 3.89, 5.9, 8.12, 9.87, 13.29, 20.29,
>>>       21.43, 22.28, 23.48, 24.65, 25.17],
>>>      [18.16, 17.88, 17.28, 15.73, 14.31, 13.58, 13, 3.61, 3.61,
>>>       3.32, 2.71, 2.23, 1.21, 0.25]])
>>> slope = NaturalSlope(terrainCoords)
>>> watertabDepths = array([[0, 5, 10, 15],
>>>                         [8, 7, 3, 0]])
>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=3)
>>> fig = watertable.plot()
watertable_example4

example script.