Skip to main content

Stereonet-based tools for rock slope kinematic analysis.

Project description

RockSlope

RockSlope is a Python library for stereonet-based structural geology and rock slope kinematic analysis. It provides a high-level workflow for handling joint orientation data, defining joint sets, computing orientation statistics, performing kinematic failure analyses, visualizing results on stereonets, and generating text-based reports.

The public API is centered around the RockMass class, which is intended for end users. Lower-level modules implement spherical geometry, statistics, plotting, and kinematic checks and are considered internal.


Features

RockSlope supports the following core capabilities:

  • Management of joint orientation data (dip direction / dip).
  • Conversion between geological orientations and spherical unit vectors.
  • Definition of joint sets using circular and rectangular selection windows.
  • Spherical statistical analysis:
    • Mean axes
    • Fisher confidence angles
    • Variability angles
    • Fisher and Davis kappa estimates
  • Stereonet plotting with Matplotlib:
    • Poles, great circles, intersections
    • Selection windows
    • Mean axes and confidence circles
    • Density plots (Kamb method)
  • Rock slope kinematic analysis:
    • Planar sliding (with and without lateral limits)
    • Wedge sliding
    • Flexural toppling
    • Direct toppling (intersection- and base-plane based)
  • Generation of reStructuredText reports summarizing statistics and kinematics.

All angles passed to the public API are expected in degrees. Internally, computations are performed in radians using unit vectors on the sphere.


Installation

Once published on PyPI:

pip install rockslope

For local development using the src layout:

python -m venv .venv
source .venv/bin/activate  # on Windows: .venv\Scripts\activate
pip install -e .[dev]

This installs RockSlope in editable mode together with development dependencies.


Quick Start

Basic Usage

import numpy as np
from rockslope import RockMass

# Joint orientations as dip direction / dip (degrees)
joints = np.array([
    [230.0, 23.0],
    [145.0, 45.0],
    [240.0, 30.0],
])

rockmass = RockMass(joints)

# Define a slope orientation
rockmass.add_slope(dip_direction=90.0, dip=45.0)

# Define joint sets using selection windows
rockmass.add_circular_selection(
    dip_direction=320.0,
    dip=25.0,
    apical_angle=60.0,
)

# Compute statistics for the defined sets
rockmass.compute_statistics()

# Compute kinematic failure modes
rockmass.compute_kinematics(joint_friction=30.0, lateral_limit=30.0)

# Plot a stereonet with planar sliding results
rockmass.plot(
    poles=True,
    selection_windows=True,
    confidence_angles="fisher",
    kinematics="planar_sliding",
    show=True,
)

Selection Windows

RockSlope supports two types of selection windows for defining joint sets:

  • Circular selection Defined by a central orientation and an apical angle.

  • Rectangular selection Defined by a central orientation with separate declination and inclination bounds.

Selections are stored internally and used for both statistical analysis and plotting.


Kinematic Analysis

Kinematic checks are performed against a defined slope orientation. The following failure modes are supported:

  • Planar sliding (with optional lateral limits)
  • Planar sliding without lateral limits
  • Wedge sliding (primary and secondary zones)
  • Flexural toppling
  • Direct toppling (intersection-based and base-plane based)

Results are stored on the RockMass instance and can be visualized on stereonets or summarized in reports.


Reporting

RockSlope can generate a text-based report in reStructuredText format:

rockmass.get_report(
    projectname="Example Slope",
    author="Author Name",
    date="2026-01-01",
    description="Kinematic analysis of a rock slope",
    save_as="report.rst",
)

The report includes:

  • Project metadata
  • Number of planes and intersections
  • Joint set statistics (if computed)
  • Kinematic analysis summary (if computed)

Data Import

Joint orientations can be loaded from CSV files:

from rockslope import joints_from_csv

joints = joints_from_csv(
    "joints.csv",
    col_dip_direction=0,
    col_dip=1,
    skip=1,
    delimiter=";",
)

The CSV file must contain dip direction and dip values in degrees.


Internal Modules

The following modules are used internally by RockMass:

  • sphericmath: spherical geometry and vector operations
  • sphericstats: spherical statistics and parameter estimation
  • selections: circular and rectangular selection windows
  • plot: Matplotlib stereonet projection and plotting utilities
  • kinematics: rock slope kinematic checks
  • rstbuilder: helpers for report generation

These modules are considered implementation details and are not part of the stable public API.


Documentation

RockSlope uses Google-style docstrings and Sphinx with the Napoleon extension. To build the documentation locally:

pip install -e .[dev]
sphinx-build -b html docs docs/_build/html

The API documentation focuses on the high-level RockMass interface.


Testing

A pytest-based test suite is included:

pip install -e .[dev]
pytest

License

RockSlope is released under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rockslope-0.1.1.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rockslope-0.1.1-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file rockslope-0.1.1.tar.gz.

File metadata

  • Download URL: rockslope-0.1.1.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rockslope-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9983bf2fa7f290b6731b8f5e7442495482c7cd4424573df0f399a34cf4b06e33
MD5 a75dda4f1013433c30aa5f7c976ab450
BLAKE2b-256 a7d111385694cc1333bf5dc186ce086d27ce6239da4db76c3da605b021aea690

See more details on using hashes here.

File details

Details for the file rockslope-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rockslope-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rockslope-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec66937a9b4d15f6a6bfbe9d37923eba02b980c4430210e6d17b75322636bc5b
MD5 2d3dd9cd376e6b76fa9d68927ad0f116
BLAKE2b-256 0facc91f25abd214e8ad3616e3d5398b6a6b9866a963a09f7982fec2f4656c79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page