Repository navigation
WP4: sonic anisotropy (gamma from Stoneley and dipole logs) - #5
Merged
Merged
Conversation
- iwt.sonic: tube-wave relation with a concentric tool and its inverse (C66 as the effective modulus, Norris & Sinha 1993); the exact Stoneley mode of a fluid-filled borehole along the axis of a TI formation, with a tool, including leaky modes on the outgoing sheet, solved for whole logs at once; dispersion-corrected C66 inversion (TI with assumed eps, delta, or the isotropic shortcut); dipole C44 moved to the Stoneley frequency and averaged to its aperture; exact gamma Jacobian and linear uncertainty propagation; mud-slowness calibration in a reference interval. - iwt.synthetic: caliper log with washouts and a Stoneley slowness log from the exact mode in the Backus medium of the array aperture. - examples/wp4_sonic_anisotropy.py and docs/figures/wp4_*.png; README and plan updated (WP4 done, as-built notes, references); version 0.4.0. - 18 new tests (111 in all). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019vaUDUPicoFeQaUhfhnoYq
There was a problem hiding this comment.
🟡 Changes recommended
The leaky-mode determinant scaling and validation workflow contain correctness issues, and the uncertainty calculation omits dispersion dependence.
4 open findings
What changed in this PR
Implements WP4 sonic anisotropy, deriving Thomsen’s γ from dipole and Stoneley logs.
Changes:
- Adds tube-wave and exact TI Stoneley modelling and inversion.
- Adds synthetic caliper/Stoneley logs, uncertainty propagation, and validation.
- Updates documentation and releases version 0.4.0.
| File | Description |
|---|---|
iwt/sonic.py |
Adds sonic anisotropy modelling and inversion. |
iwt/synthetic.py |
Adds caliper and Stoneley logs. |
tests/test_sonic.py |
Adds WP4 tests. |
examples/wp4_sonic_anisotropy.py |
Demonstrates processing and uncertainty analysis. |
README.md |
Documents WP4 usage and results. |
docs/IMPLEMENTATION_PLAN.md |
Marks WP4 complete. |
iwt/__init__.py |
Exports the sonic module and version. |
pyproject.toml |
Bumps version to 0.4.0. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+232
to
+240
| ea = np.exp(-f * (b - a)) | ||
| c = 0.0 if np.isinf(kt) else pf * a / (2.0 * kt) | ||
| M = np.array([ | ||
| [f * ive(1, f * b), -f * kve(1, f * b) * ea, col[0][0], col[1][0]], | ||
| [-pf * ive(0, f * b) / sc, -pf * kve(0, f * b) * ea / sc, col[0][1], col[1][1]], | ||
| [zero, zero, col[0][2], col[1][2]], | ||
| [(f * ive(1, f * a) + c * ive(0, f * a)) * ea, | ||
| -f * kve(1, f * a) + c * kve(0, f * a), zero, zero], | ||
| ]) |
Comment on lines
+88
to
+94
| c44_m = S.running_average(z, logs.rho * logs.vs ** 2, APERTURE, harmonic=True) | ||
| rho_m = S.running_average(z, logs.rho, APERTURE) | ||
| vs_m = np.sqrt(c44_m / rho_m) | ||
| qs = 0.5 * model.qp[model.layer_index(z)] | ||
| f_dip = logs.meta["f_sonic_s"] | ||
| base = (logs.vp, logs.vs, logs.rho, st.slowness) | ||
| matched = (logs.vp, vs_m, rho_m, st.slowness) |
Comment on lines
+127
to
+129
| s_tube = st.slowness / final.dispersion | ||
| J = S.gamma_jacobian(s_tube, 1.0 / vs_m, rho_m, mud_cal.slowness, mud_cal.density, caliper, | ||
| TOOL.tool_radius, 0.0) |
Comment on lines
+245
to
+246
| - **Tool term:** built as planned. **Eccentricity is not modelled.** Norris (1990) reports | ||
| that it lowers the tube-wave speed, but the size of the effect was not quantified here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR implements work package 4 of
docs/IMPLEMENTATION_PLAN.md: Thomsen's γ in a vertical well, from the dipole C44 and the Stoneley-derived C66 (Walsh et al., 2007). It is validated on the synthetic Wisting-like well, where the true γ is known.What is added
iwt.soniciwt.synthetic: a caliper log with washouts, and a Stoneley log computed with the exact mode in the Backus average of the model over the array aperture.examples/wp4_sonic_anisotropy.py(about 50 s) anddocs/figures/wp4_*.png.Results on the synthetic well
Departures from the plan
Tests
🤖 Generated with Claude Code
https://claude.ai/code/session_019vaUDUPicoFeQaUhfhnoYq
Generated by Claude Code