mcpField
S
striplog

striplog

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

striplog について

striplogは、岩相などの地質データを深度区間として扱うPythonライブラリです。地質・検層のワークフロー向けに、検索、統計、描画、構造化ログの出力を行えます。

主な機能

  1. 01CSVやテキストからログを作成
  2. 02深度区間の検索と切り出し
  3. 03ネット・グロス比の計算
  4. 04検層ログの描画と対比
  5. 05CSV、LAS、JSONへの出力

活用シーン

  1. 01坑井データから岩相ログを作成
  2. 02複数坑井の区間を比較
  3. 03岩相ごとの割合を計算
  4. 04後続分析向けにログを出力

インストール

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

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

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

同梱ファイル

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

references/
components.md
lexicon.md
scripts/
create_striplog.py

詳細

striplog - 岩相ログ

クイックリファレンス

from striplog import Striplog, Interval, Component

# Create from intervals
intervals = [
    Interval(top=0, base=10, components=[Component({'lithology': 'sandstone'})]),
    Interval(top=10, base=25, components=[Component({'lithology': 'shale'})]),
    Interval(top=25, base=40, components=[Component({'lithology': 'limestone'})]),
]
strip = Striplog(intervals)

# Load from file
strip = Striplog.from_csv('lithology.csv')  # Columns: top, base, lithology

# Access and display
print(strip)
strip.plot()
df = strip.to_dataframe()

主要なクラス

クラス用途
Striplogメインのログコンテナ。区間を保持します
Interval上端、下端、構成要素を持つ深度区間
Componentプロパティを持つ岩石タイプの定義
Lexicon同義語を含む岩石タイプ辞書
Legend可視化のスタイル(色、パターン)

基本操作

CSVから作成
# CSV format: top,base,lithology
strip = Striplog.from_csv('lithology.csv')
strip.plot()
説明テキストから作成
from striplog import Striplog, Lexicon

description = """
0.0 - 5.5 m: Fine to medium sandstone
5.5 - 12.0 m: Grey shale with silt laminations
12.0 - 18.5 m: Massive limestone, fossiliferous
"""
strip = Striplog.from_description(description, lexicon=lexicon)
クエリと抽出
# Get interval at depth
interval = strip.read_at(z=15)
print(interval.primary.lithology)

# Crop to depth range
subset = strip.crop((10, 30))

# Unique lithologies
lithologies = strip.unique('lithology')
統計
# Net-to-gross for specific lithology
ntg = strip.net_to_gross(pattern={'lithology': 'sandstone'})
print(f"Sandstone: {ntg * 100:.1f}%")

# Merge adjacent same-lithology intervals
merged = strip.merge_neighbours()
坑井の対比
import matplotlib.pyplot as plt

wells = [Striplog.from_csv(f'well{i}.csv') for i in range(1, 4)]
fig, axes = plt.subplots(1, 3, figsize=(10, 8), sharey=True)

for ax, well, name in zip(axes, wells, ['Well 1', 'Well 2', 'Well 3']):
    well.plot(ax=ax, legend=legend)
    ax.set_title(name)

plt.tight_layout()
plt.savefig('correlation.png')
エクスポート
strip.to_csv('output.csv')
strip.to_las('output.las')
strip.to_json('output.json')
df = strip.to_dataframe()

ハッチングパターン

パターンコード典型的な用途
ドット...砂岩
ダッシュ---頁岩
プラス+++石灰岩
Xxxxドロマイト
Vvvv火山岩

代替ツールとの使い分け

ツール最適な用途
striplog構造化された岩相ログ、区間ベースのデータ、NTG、対比
welly坑井ログ曲線(連続データ)、複数坑井のプロジェクト
custom matplotlib区間ロジックを必要としない、単純な単発の層序柱状図

striplogを使う場合は、クエリ、統計、対比が可能な構造化オブジェクトとして、地質区間(岩相、 堆積相)を表現する必要があるときです。

代わりにwellyを使う場合は、連続的な坑井ログ曲線(GR、RHOB)を扱うときです。 wellyとstriplogは相互に補完するもので、曲線にはwelly、岩相区間にはstriplogを使います。

代わりにcustom matplotlibを使う場合は、区間のクエリやネット・トゥ・グロスの計算が不要な、 単純な単発の層序柱状図を作成するときです。

よくあるワークフロー

CSVデータから岩相ログを作成する
- [ ] Prepare CSV with columns: top, base, lithology (optionally color)
- [ ] Load with `Striplog.from_csv('lithology.csv')`
- [ ] Define Legend with colors and hatch patterns for each lithology
- [ ] Verify intervals: check for gaps or overlaps
- [ ] Merge adjacent same-lithology intervals with `merge_neighbours()`
- [ ] Compute statistics: `net_to_gross()`, `unique()`
- [ ] Plot with legend and export to desired format

よくある問題

問題解決策
テキストを解析できない同義語を含むLexiconを定義します
色が違うDecorオブジェクトを使ってカスタムLegendを作成します
ログに隙間がある区間の上端と下端の値が一致しているか確認します
プロットがおかしい深度の方向(下に向かって増加)を確認します

参考資料

スクリプト

コメント