mcpField
M
mplstereonet

mplstereonet

github.com/steadfastasartデータ・データベース7359 回インストール6 週間前に更新
リポジトリ

mplstereonet について

mplstereonetは、Matplotlibでステレオネットを描き、地質学的な方位データを分析するPythonライブラリです。平面、極、線構造の描画に加え、密度コンターや方位のフィッティングを行えます。

主な機能

  1. 01Matplotlibのステレオネット作成
  2. 02平面・極・線構造の描画
  3. 03方位密度コンターの生成
  4. 04ガードルフィットと平均方位の算出
  5. 05方位形式の変換

活用シーン

  1. 01層理方位のステレオネット表示
  2. 02褶曲軸と節理群の分析
  3. 03再現可能な構造地質図の作成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/steadfastasart/geoscience-skills --skill mplstereonet

インストール後、Claude Code で/mplstereonetを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
plotting_options.md
projections.md
scripts/
structural_analysis.py

詳細

mplstereonet - Matplotlib用ステレオネット

クイックリファレンス

import mplstereonet
import matplotlib.pyplot as plt

# Create stereonet
fig, ax = mplstereonet.subplots()

# Plot plane and pole (strike/dip, right-hand rule)
ax.plane(315, 45, 'b-')          # Great circle
ax.pole(315, 45, 'ko')           # Pole to plane

# Plot lineation (trend/plunge)
ax.line(120, 30, 'r^')

ax.grid()
plt.savefig('stereonet.png', dpi=150)

主な関数

関数目的
mplstereonet.subplots()ステレオネットの図と座標軸を作成
ax.plane(strike, dip)大円をプロット
ax.pole(strike, dip)面の極をプロット
ax.line(trend, plunge)線構造の点をプロット
ax.density_contourf()塗りつぶし密度等高線
mplstereonet.fit_girdle()最適な大円
mplstereonet.find_mean_vector()平均方位

基本操作

等高線を使った複数の測定値
import numpy as np

strikes = [45, 52, 38, 48, 55, 41, 50, 43]
dips = [25, 30, 22, 28, 35, 24, 32, 27]

fig, ax = mplstereonet.subplots()

# Density contour of poles
ax.density_contourf(strikes, dips, measurement='poles', cmap='Reds')
ax.pole(strikes, dips, 'k.', markersize=5)

ax.grid()
ax.set_title('Bedding Orientations')
plt.savefig('density.png', dpi=150)
平均方位を計算
# Fit best-fit plane (girdle)
mean_strike, mean_dip = mplstereonet.fit_girdle(strikes, dips)

# Or calculate mean pole for clustered data
lon, lat = mplstereonet.pole(strikes, dips)
mean_lon, mean_lat = mplstereonet.find_mean_vector(lon, lat)
mean_s, mean_d = mplstereonet.pole2strike(mean_lon, mean_lat)
パイダイアグラム(褶曲軸)
# Bedding measurements around a fold
strikes = np.array([20, 35, 50, 70, 90, 110, 130, 150, 165, 180])
dips = np.array([45, 40, 35, 30, 25, 30, 35, 40, 45, 50])

fig, ax = mplstereonet.subplots()
ax.pole(strikes, dips, 'ko', markersize=6)

# Fit girdle to poles - fold axis is pole to girdle
girdle_strike, girdle_dip = mplstereonet.fit_girdle(strikes, dips)
ax.plane(girdle_strike, girdle_dip, 'r-', linewidth=2)

fold_trend, fold_plunge = mplstereonet.pole(girdle_strike, girdle_dip)
ax.line(fold_trend, fold_plunge, 'r^', markersize=12, label='Fold axis')

ax.grid()
ax.legend()
断層面とすべりベクトル
fault_strike, fault_dip = 45, 60
rake = 30  # Degrees from strike

# Convert rake to trend/plunge
slip_trend, slip_plunge = mplstereonet.rake(fault_strike, fault_dip, rake)

fig, ax = mplstereonet.subplots()
ax.plane(fault_strike, fault_dip, 'r-', linewidth=2)
ax.line(slip_trend, slip_plunge, 'r>', markersize=10)
ax.grid()
複数の節理セット
set1 = {'strikes': [45, 50, 42, 48], 'dips': [70, 75, 68, 72]}
set2 = {'strikes': [135, 140, 130, 138], 'dips': [60, 65, 58, 62]}

fig, ax = mplstereonet.subplots()
ax.pole(set1['strikes'], set1['dips'], 'ro', label='Set 1')
ax.pole(set2['strikes'], set2['dips'], 'bs', label='Set 2')
ax.grid()
ax.legend()

測定値の表記規則

形式説明例
走向/傾斜右手の法則(走向の右側へ傾斜)045/60
傾斜方向/傾斜傾斜方向の方位角135/60
トレンド/プランジ線状の方位180/30

形式の変換

# Strike/dip to dip direction
strike, dip = 45, 60
dip_direction = (strike + 90) % 360

# Pole to strike/dip
lon, lat = mplstereonet.pole(strike, dip)
back_strike, back_dip = mplstereonet.pole2strike(lon, lat)

等高線の手法

手法説明
kamb統計的有意性(デフォルト)
schmidt点計数
exponential_kamb平滑化されたKamb

代替手段との比較と使い分け

ツール最適な用途制限事項
mplstereonetPythonでの手軽なステレオネット作成、matplotlibとの統合、スクリプト化されたワークフローインタラクティブな回転には非対応、3D機能は限定的
apsg高度な構造解析、テンソル、方位統計学習曲線が急
JTOPOGUIでのインタラクティブな探索、教育Javaベース、スクリプト化できない

次の場合はmplstereonetを使用してください。 matplotlibと統合したプログラムによるステレオネットの生成、方位データセットの一括処理、または論文向けの再現可能な構造プロットが必要な場合です。

次の場合は代替手段を検討してください。 方位のインタラクティブな3D可視化が必要な場合(apsgを使用)、教育や手早い確認のためのGUIが必要な場合(JTOPOを使用)、またはmplstereonetで提供される範囲を超える高度なテンソル統計が必要な場合です。

一般的なワークフロー

層理面の方位を解析して褶曲軸を特定する
  • CSVまたは配列から走向/傾斜の測定値を読み込む
  • mplstereonet.subplots()でステレオネットを作成する
  • ax.pole(strikes, dips)で層理面の極をプロットする
  • ax.density_contourf()で密度等高線を生成する
  • mplstereonet.fit_girdle()で極に大円をフィッティングする
  • mplstereonet.pole()で大円の極として褶曲軸を計算する
  • ax.line(trend, plunge)で褶曲軸をプロットする
  • グリッドと凡例を追加し、図を保存する

参考資料

スクリプト

コメント