Rock Physics Avo logo

Rock Physics Avo

Community
SteadfastAsArt
rock-physics-avo

Rock physics and AVO analysis workflow from well log preparation through elastic property calculation, fluid substitution, AVO modelling, and synthetic seismogram generation. Use when performing rock physics studies or AVO feasibility analysis.

Overview

PublisherSteadfastAsArt
Repositorygeoscience-skills
Skill namerock-physics-avo
Stars
75
Forks
9
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by SteadfastAsArt on GitHub. Read the source before you install it.

Installation

Install the Rock Physics Avo AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/SteadfastAsArt/geoscience-skills/tree/main/workflows/rock-physics-avo
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SteadfastAsArt/geoscience-skills.git /tmp/geoscience-skills
mkdir -p .claude/skills
cp -r /tmp/geoscience-skills/workflows/rock-physics-avo .claude/skills/rock-physics-avo
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Rock Physics Avo in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Rock Physics Avo on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Rock Physics Avo is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Rock Physics & AVO Workflow

End-to-end pipeline for rock physics analysis and AVO feasibility studies, from well log preparation through elastic property calculation, Gassmann fluid substitution, AVO modelling, and synthetic seismogram generation.

Skill Chain

text
lasio / welly          bruges                    segyio / obspy
[Well Log Prep]     --> [Rock Physics]         --> [Synthetics / Tie]
  |                      |                          |
  Load LAS/DLIS          Elastic moduli             Wavelet extraction
  QC & despike           Gassmann fluid sub         Reflectivity series
  Resample curves        AVO intercept/gradient     Convolve synthetic
  Extract Vp, Vs, rho    Backus averaging           Well-seismic tie

Decision Points

TaskLibraryWhen to Use
Load well logslasio / dlisioWhen logs are not already loaded
Curve QC and managementwellyMulti-curve processing, despiking
Elastic moduli, AVO equationsbrugesCore rock physics calculations
Gassmann fluid substitutionbrugesPredict fluid replacement effects
Wavelet extraction from seismicsegyio + brugesWhen tying to seismic
Synthetic seismogrambrugesGenerate reflectivity and convolve
Dispersion curvesdisbaSurface wave rock physics

Step-by-Step Orchestration

Stage 1: Well Log Preparation (lasio + welly)

Select and QC a contiguous interval before these calculations. Required curves are DT and RHOB; DTS is optional. This example explicitly permits the Castagna estimate for missing DTS in an appropriate siliciclastic interval. It is an empirical estimate, not a measured shear log. Nulls in unrelated curves must not remove elastic samples, and invalid elastic samples must not be silently bridged.

python
import lasio
import numpy as np

las = lasio.read('well.las')
df = las.df().copy()

def unit(curve):
    return las.curves[curve].unit.replace('µ', 'u').replace('μ', 'u').upper().replace(' ', '')

def sonic_velocity(curve):
    factors = {'US/FT': 0.3048e6, 'US/M': 1e6}
    values = df[curve].to_numpy(dtype=float)
    if unit(curve) not in factors:
        raise ValueError(f'Confirm sonic units for {curve}: {unit(curve)}')
    if not np.all(np.isfinite(values) & (values > 0)):
        raise ValueError(f'QC {curve}: nonpositive or missing transit times')
    return factors[unit(curve)] / values  # m/s

vp = sonic_velocity('DT')
vs_estimated = 'DTS' not in df.columns
if vs_estimated:
    vs = 0.8621 * vp - 1172.4
else:
    vs = sonic_velocity('DTS')  # Check existence before reading

density_factors = {'G/CC': 1000.0, 'G/CM3': 1000.0, 'G/C3': 1000.0, 'KG/M3': 1.0}
if unit('RHOB') not in density_factors:
    raise ValueError('Confirm RHOB units before converting to kg/m3')
rho = df['RHOB'].to_numpy(dtype=float) * density_factors[unit('RHOB')]
if not np.all(np.isfinite(rho) & (rho > 0) & (vs > 0) & (vp**2 > 4/3 * vs**2)):
    raise ValueError('Invalid elastic inputs: require positive density, Vs and bulk modulus')

depth_factors = {'M': 1.0, 'FT': 0.3048}
depth_unit = unit(las.curves[0].mnemonic)
if depth_unit not in depth_factors:
    raise ValueError('Confirm LAS depth units')
depth_m = df.index.to_numpy(dtype=float) * depth_factors[depth_unit]
if len(depth_m) < 2 or not np.all(np.isfinite(depth_m)) or np.any(np.diff(depth_m) <= 0):
    raise ValueError('Provide at least two samples on an increasing depth basis')

Stage 2: Rock Physics Analysis (bruges)

python
import bruges

# Elastic moduli from velocities
K = bruges.rockphysics.moduli.bulk(vp=vp, vs=vs, rho=rho)   # Bulk modulus
G = bruges.rockphysics.moduli.mu(vs=vs, rho=rho)            # Shear modulus, Pa
E = bruges.rockphysics.moduli.youngs(bulk=K, mu=G)          # Young's modulus, Pa
nu = bruges.rockphysics.moduli.pr(vp=vp, vs=vs)             # Poisson's ratio
AI = vp * rho                                             # Acoustic impedance, SI
SI = vs * rho                                             # Shear impedance, SI

# Vp/Vs ratio (key AVO indicator)
vp_vs = vp / vs

Stage 3: Gassmann Fluid Substitution (bruges)

This branch assumes a brine-saturated, isotropic interval with connected pores, an unchanged frame, and suitable low-frequency conditions. Supply interpreted porosity as PHIE in v/v; raw NPHI requires lithology/gas corrections first. Fluid properties below are illustrative and must match formation conditions.

python
from bruges.rockphysics.fluidsub import avseth_fluidsub

if unit('PHIE') != 'V/V':
    raise ValueError('Supply interpreted PHIE in v/v for fluid substitution')
phi = df['PHIE'].to_numpy(dtype=float)
if not np.all(np.isfinite(phi) & (phi > 0) & (phi < 1)):
    raise ValueError('Fluid substitution requires finite porosity between 0 and 1')

# Mineral and fluid properties
K_mineral = 36.6e9   # Quartz bulk modulus (Pa)
K_brine = 2.6e9      # Brine bulk modulus (Pa)
rho_brine = 1050     # Brine density (kg/m3)
K_gas = 0.02e9       # Gas bulk modulus (Pa)
rho_gas = 100        # Gas density (kg/m3)

# The library performs inverse/forward Gassmann; VRH mixing is not this operation.
vp_gas, vs_gas, rho_gas_sat = avseth_fluidsub(
    vp=vp, vs=vs, rho=rho, phi=phi,
    rhof1=rho_brine, rhof2=rho_gas,
    kmin=K_mineral, kf1=K_brine, kf2=K_gas,
)
if not np.all(np.isfinite([vp_gas, vs_gas, rho_gas_sat])):
    raise ValueError('Invalid substituted model; review frame and fluid assumptions')

Stage 4: AVO Analysis (bruges)

python
# Keep every adjacent interface, rather than overwriting the last result.
angles_deg = np.arange(0, 40, 1)
upper = (vp[:-1], vs[:-1], rho[:-1])
lower = (vp[1:], vs[1:], rho[1:])
rc = bruges.reflection.shuey(*upper, *lower, theta1=angles_deg)
intercept, gradient = bruges.reflection.shuey(
    *upper, *lower, return_gradient=True
)

# AVO classification from intercept (R0) and gradient (G)
# Class I:   R0 > 0, G < 0  (hard sand, dim with offset)
# Class II:  R0 ~ 0, G < 0  (near-zero, polarity reversal)
# Class III: R0 < 0, G < 0  (soft sand, bright with offset)
# Class IV:  R0 < 0, G > 0  (very soft, dim with offset)

# Zoeppritz exact for full offset range
rc_exact = bruges.reflection.zoeppritz_rpp(*upper, *lower, theta1=angles_deg)

Stage 5: Synthetic Seismogram (bruges + segyio)

Supply time_depth.csv with columns depth_m,twt_s from checkshots or a calibrated sonic integration. Its depth basis and datum must match the LAS samples: measured depth is not automatically TVD. Interpolate impedance onto uniform two-way time before convolving a time-domain wavelet. For a well tie, select a seismic trace by survey coordinates and compare matching time axes; trace 0 is not a well location.

python
from scipy.signal import convolve

time_depth = np.loadtxt('time_depth.csv', delimiter=',', skiprows=1, ndmin=2)
if (time_depth.shape[1] != 2 or len(time_depth) < 2
        or not np.all(np.isfinite(time_depth))
        or np.any(np.diff(time_depth, axis=0) <= 0)):
    raise ValueError('Require increasing finite depth_m and twt_s columns')
if depth_m[0] < time_depth[0, 0] or depth_m[-1] > time_depth[-1, 0]:
    raise ValueError('Time-depth relation must cover the entire selected log interval')
twt_s = np.interp(depth_m, time_depth[:, 0], time_depth[:, 1])
dt_s = 0.002
twt_regular_s = np.arange(twt_s[0], twt_s[-1] + dt_s * 1e-6, dt_s)
if len(twt_regular_s) < 2:
    raise ValueError('Selected time interval is shorter than one sample')
impedance_t = np.interp(twt_regular_s, twt_s, vp * rho)
rc_series = np.r_[0.0, np.diff(impedance_t) / (impedance_t[:-1] + impedance_t[1:])]

# Bruges returns amplitudes first, time samples second.
wavelet, wavelet_time = bruges.filters.ricker(duration=0.128, dt=dt_s, f=25)
synthetic = convolve(rc_series, wavelet, mode='same')
assert synthetic.shape == twt_regular_s.shape

Repeat Stages 4–5 with the substituted velocities/density to compare fluid scenarios, using the same chosen time-depth relation unless a travel-time change is explicitly being modelled. Report correlation together with wavelet, time-depth provenance, and any justified alignment edits; unconstrained stretching can hide a poor model.

Common Pipelines

AVO Feasibility Study

text
- [ ] Load well logs (Vp, Vs, Rho, porosity) with lasio
- [ ] QC a contiguous log interval; retain raw data and document any justified gap treatment
- [ ] If no Vs log: estimate from Castagna or Greenberg-Castagna
- [ ] Calculate elastic moduli and impedances with bruges
- [ ] Run Gassmann fluid substitution (brine to gas/oil)
- [ ] Compare Vp, Vs, density, impedance before/after fluid sub
- [ ] Compute AVO response at target interface (Shuey or Zoeppritz)
- [ ] Classify AVO response (Class I-IV)
- [ ] Generate synthetic seismograms for both fluid scenarios
- [ ] Plot AVO crossplot (intercept vs gradient)

Well-Seismic Tie

text
- [ ] Load well logs and seismic trace at well location
- [ ] Create time-depth relationship from check shots or sonic
- [ ] Convert logs to time domain
- [ ] Extract wavelet from seismic (statistical or deterministic)
- [ ] Generate synthetic seismogram from reflectivity * wavelet
- [ ] Cross-correlate synthetic with seismic trace
- [ ] Constrain any alignment edits with checkshots and document their justification
- [ ] Report correlation coefficient

Backus Averaging (Upscaling)

text
- [ ] Load thin-bed well logs at fine sampling (0.5 ft)
- [ ] Define averaging window (e.g., quarter wavelength at target frequency)
- [ ] Apply Backus averaging to get effective anisotropic elastic properties
- [ ] Compare fine-scale vs upscaled reflectivity
- [ ] Assess thin-bed tuning effects

When to Use

Use the rock physics & AVO workflow when:

  • Performing AVO feasibility studies for exploration prospects
  • Running Gassmann fluid substitution to predict fluid effects
  • Generating synthetic seismograms for well-seismic ties
  • Calculating elastic properties from well logs
  • Classifying AVO response at target horizons

Use individual domain skills when:

  • Only loading well logs (use lasio alone)
  • Only computing dispersion curves (use disba alone)
  • Only creating wavelets or filters (use bruges alone)

Common Issues

IssueSolution
No shear sonic logEstimate Vs from Castagna mudrock line or Greenberg-Castagna
Gassmann gives unrealistic velocitiesCheck porosity and mineral modulus inputs; phi must be > 0
Negative Poisson's ratioUsually indicates bad Vs data; QC shear sonic
Poor well-seismic tieCheck time-depth relationship; try different wavelets
AVO effect too smallMay be real; check impedance contrast and Vp/Vs ratio
Fluid sub in shalesReview anisotropy, pore connectivity and frequency assumptions before applying Gassmann

API Sources

Frequently asked questions

What does the Rock Physics Avo AI skill do?

Rock physics and AVO analysis workflow from well log preparation through elastic property calculation, fluid substitution, AVO modelling, and synthetic seismogram generation. Use when performing rock physics studies or AVO feasibility analysis.

Why use Rock Physics Avo on TypingMind?

Because you install it once and use it with any model. Rock Physics Avo is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Rock Physics Avo in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/SteadfastAsArt/geoscience-skills/tree/main/workflows/rock-physics-avo. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Rock Physics Avo?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Rock Physics Avo?

As many as you like. As long as a model supports skills, you can use Rock Physics Avo with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Rock Physics Avo AI skill free?

Yes. It is published on GitHub by SteadfastAsArt under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇