Skip to content

Assistance in the analysis of dip/direction measurements of rock mass discontinuities

License

Notifications You must be signed in to change notification settings

FGBASTANTE/rock_joint_sets

Repository files navigation

image

Rock Joint Sets Analyzer

This Python module provides a flexible workflow for analyzing geological joint sets from dip-direction/dip measurements. By integrating stereographic projection and clustering algorithms from mplstereonetand kmedoids packages, it enhances the estimation of joint set families — offering greater control and adaptability in the analysis process. Visualization is handled using the mplstereonet package, which supports stereonet plotting of planes, poles, and cluster centroids.

Fernando García Bastante
Universidade de Vigo
For Educational Purposes

📌 Features

  • 🧭 Geological Data Input: Reads dip-direction and dip angle pairs from plain text files.
  • 📊 Clustering: Uses k-means and optionally k-medoids to identify joint set groupings.
  • 📐 Centroid Calculation: Computes the centroid (average orientation) of each joint set.
  • 📈 Stereonet Visualization:
    • Poles to planes
    • Cluster centroids
    • Density contours

🔧 Installation

Step-by-step Setup

  1. Create a new Python environment (recommended):
conda create -n sets_env
conda activate sets_env
  1. Install required dependencies:
conda install numpy matplotlib mplstereonet kmedoids
  1. Download the module:

Simply download and save the rock_joint_sets.py file in your working directory. You can then import it directly in your scripts or notebooks.

📁 Data Input Format

The input should be a plain .txt file with each line containing a dip direction and dip angle, separated by whitespace or a custom delimiter:

120 45
133 50
147 42
...

🗂️ Example Use Case

[Please open and run the example file: rock_join_sets_use.ipynb]

import rock_joint_sets as rjs

# Set file and desired number of clusters
data_file = "my_set.txt"
num = 3

# Run analysis
rjs.run_example(data_file, num)

Or more explicitly:

data = rjs.read_data("my_set.txt", delimit="")
strike_cent, dip_cent = rjs.centroids_cal(data, num)
rjs.draw_data_centroids(data, strike_cent, dip_cent)

📊 Output

  • Plots: Stereonet plots with:
    • Poles of input measurements
    • Centroid planes
    • Cluster visualization
  • Numerical Data: Strike and dip of the centroids printed or returned.

🙏 Acknowledgements

This project would not be possible without the excellent open-source tools it builds upon:

  • mplstereonet: A powerful Python library for plotting and calculating stereographic projections, essential for structural geology workflows. It is the backbone of the stereonet visualizations and performs critical geometric computations.

  • kmedoids: A flexible implementation of the k-medoids clustering algorithm in Python. It allows more robust identification of joint set clusters by minimizing dissimilarities using medoid representatives.

We are deeply grateful to the authors and maintainers of these libraries for their contributions to the scientific Python ecosystem.

About

Assistance in the analysis of dip/direction measurements of rock mass discontinuities

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published