6. slope

Module for defining the class related to the slope geometry.

class slope.AnthropicSlope(slopeHeight, slopeDip, crownDist, toeDist, depth=None)[source]

Bases: object

Creates an instance of an object that defines the geometrical frame of the slope to perform the analysis given the geometric properties of the slope.

AnthropicSlope(slopeHeight, slopeDip, crownDist, toeDist, depth=None)

The geometry of the slope is as follow:

  • It is a right slope, i.e. its face points to the right side.
  • Crown and toe planes are horizontal.
  • The face of the slope is continuous, ie, it has not berms.
slopeHeight

Height of the slope, ie, vertical length betwen crown and toe planes.

Type:int or float
slopeDip

Both horizontal and vertical components of the slope inclination given in that order.

Type:(2, ) tuple, list or numpy.ndarray
crownDist

Length of the horizontal plane in the crown of the slope.

Type:int or float
toeDist

Length of the horizontal plane in the toe of the slope.

Type:int or float
depth

Length of the segment beneath the slope toe. None is the default value; if is None, then the maximum depth is calculated.

Type:int or float or None

Note

The class AnthropicSlope requires numpy and matplotlib.

Examples

>>> from pybimstab.slope import AnthropicSlope
>>> slope = AnthropicSlope(slopeHeight=12, slopeDip=[1, 1.5],
>>>                        crownDist=10, toeDist=10)
>>> slope.__dict__.keys()
{'coords': array(
        [[ 0.        ,  0.        , 10.        , 18.        ,
          28.        , 28.        ,  0.        ],
         [ 0.        , 16.57142857, 16.57142857,  4.57142857,
           4.57142857,  0.        ,  0.        ]]),
 'crownDist': 10,
 'depth': 4.571428571428573,
 'slopeDip': array([1. , 1.5]),
 'slopeHeight': 12,
 'toeDist': 10}
maxDepth()[source]

Method to obtain the maximum depth of a slope where a circular slope failure analysis can be performed.

The maximum depth is such that the biggest circle satisfished the following conditions:

  • It is tangent to the bottom.
  • crosses both the extreme points at the crown and toe.
  • It is orthogonal to the crown plane.
Returns:Maximum depth of the slope measured vertically from the toe plane.
Return type:(int or float)

Examples

>>> from pybimstab.slope import AnthropicSlope
>>> slope = AnthropicSlope(slopeHeight=12, slopeDip=[1, 1.5],
                           crownDist=10, toeDist=10)
>>> slope.maxDepth()
4.571428571428573
defineBoundary()[source]

Method to obtain the coordinates of the boundary vertices of the slope and plot it if it is wanted.

The origin of the coordinates is in the corner of the bottom with the back of the slope. The coordinates define a close polygon, ie, the first pair of coordinates is the same than the last one.

Returns:Coordinates of the boundary vertices of the slope.
Return type:(numpy.ndarray)

Examples

>>> from pybimstab.slope import AnthropicSlope
>>> slope = AnthropicSlope(slopeHeight=12, slopeDip=[1, 1.5],
>>>                        crownDist=10, toeDist=10)
>>> slope.defineBoundary()
array([[ 0.   ,  0.   , 10.   , 18.   , 28.   , 28.   ,  0.   ],
       [ 0.   , 16.571, 16.571,  4.571,  4.571,  0.   ,  0.   ]])
plot()[source]

Method for generating a graphic of the slope boundary.

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 pybimstab.slope import AnthropicSlope
>>> slope = AnthropicSlope(slopeHeight=12, slopeDip=[1, 1.5],
>>>                        crownDist=10, toeDist=10)
>>> fig = slope.plot()
slope_AnthropicSlope_example1

example script.

class slope.NaturalSlope(terrainCoords, depth=None)[source]

Bases: object

Creates an instance of an object that defines the geometrical frame of the slope to perform the analysis given the terrain coordinates.

NaturalSlope(terrainCoords, depth=None)

The geometry of the slope is as follow:

  • It is a right slope, i.e. its face points to the right side.
  • The slope is defined with its surface’s coordinates.
  • The surface is defined as a polyline such that each segment’s slope are always zero or negative.
  • The coordinates’ order is such that the highest (and leftmost) point is the first one, and the lowest (and rightmost) is the last one.
terrainCoords

(2, n) array with the coordinates of the slope surface. It must not be a closed polyline, just the terrain segment.

Type:numpy.ndarray
depth

Length of the segment beneath the slope toe. None is the default value; if is None, then the maximum depth is calculated.

Type:int or float or None

Note

The class NaturalSlope requires numpy and matplotlib.

Examples

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> coords = array(
>>>     [[ 0.   , 28.   , 28.   , 18.   , 10.   ,  0.   ],
>>>      [ 0.   ,  0.   ,  4.571,  4.571, 16.571, 16.571]])
>>> slope = NaturalSlope(coords)
>>> slope.__dict__.keys()
dict_keys(['coords', 'slopeHeight', 'maxDepth', 'coords'])
maxDepth()[source]

Method to obtain the maximum depth of a slope where a circular slope failure analysis can be performed.

The maximum depth is such that the biggest circle satisfished the following conditions:

  • It is tangent to the bottom.
  • crosses both the extreme points at the crown and toe.
  • It is orthogonal to the crown plane.
Returns:Maximum depth of the slope measured vertically from the rightmost point of the surface coordinates.
Return type:(int or float)

Examples

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> terrainCoords = array(
>>>     [[0, 10, 18, 28], [16.571, 16.571,  4.571,  4.571]])
>>> slope = NaturalSlope(terrainCoords)
>>> slope.maxDepth()
4.571428571428571
defineBoundary()[source]

Method to obtain the coordinates of the boundary vertices of the slope and plot it if it is wanted.

The origin of the coordinates is in the corner of the bottom with the back of the slope. The coordinates define a closed polygon, ie, the first pair of coordinates is the same than the last one. That closed polygon is sorted clockwise.

Returns:Coordinates of the boundary vertices of the slope.
Return type:(numpy.ndarray)

Examples

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> terrainCoords = array(
>>>     [[0, 10, 18, 28], [16.571, 16.571,  4.571,  4.571]])
>>> slope = NaturalSlope(terrainCoords)
>>> slope.defineBoundary()
array([[ 0.  ,  0.  , 10.  , 18.  , 28.  , 28.  ,  0.  ],
       [ 0.  , 16.57, 16.57,  4.57,  4.57,  0.  ,  0.  ]])
>>> from numpy import array
>>> 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)
>>> slope.defineBoundary()
array([[0, 0,  2.59, 4.19, 6.38,  8.39, 10.61, 12.36, 15.78, 22.78,
        23.92, 24.77, 25.97, 27.14, 27.66, 27.66, 0],
       [0, 19.63, 19.35, 18.75, 17.2 , 15.78, 15.05, 14.47,  5.08,
        5.08, 4.79, 4.18, 3.7 , 2.68,  1.72, 0, 0]])
plot()[source]

Method for generating a graphic of the slope boundary.

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 NaturalSlope
>>> terrainCoords = array(
>>>     [[0, 10, 18, 28], [16.571, 16.571,  4.571,  4.571]])
>>> slope = NaturalSlope(terrainCoords)
>>> fig = slope.plot()
slope_NaturalSlope_example1

example script.

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> 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)
>>> fig = slope.plot()
slope_NaturalSlope_example2

example script.