import os
import numpy as np
import pysegy
os.environ["DEVITO_LOGGING"] = "INFO"
from devitohorizon.data import Dataset
from devitohorizon.physics import DevitoPhysics
SEAM_VP = os.path.expanduser("~/data/seam/SEAM_Vp_Elastic_N23900.sgy")Constrained Physics: Elastic Modeling, Acoustic Imaging
Real datasets rarely come with a full elastic model. This tutorial starts from a P-velocity model only, runs iso-elastic forward modeling — the missing shear velocity and density are synthesized from physical relations — and then images the data with an acoustic impedance (Z) RTM, switching the physics for a single call.
It uses the SEAM P-wave model (~/data/seam/SEAM_Vp_Elastic_N23900.sgy), a 35 km × 15 km SEG-Y, downsampled to a 40 m grid via target_spacing.
Build iso-elastic physics from a vp SEG-Y
We point DevitoPhysics straight at the SEAM P-velocity SEG-Y. Because the target physics is iso-elastic but only vp is present, the loader completes the model:
vsfrom a constantvp/vsratio (vp_vs_ratio), forced to zero in the water column;b(buoyancy) from Gardner’s relation, forced to unit density in water.
target_spacing resamples the model to a coarser grid so the example runs in a minute or so.
physics = DevitoPhysics(
physics="iso-elastic", # force the recipe; vp alone looks acoustic
vp_vs_ratio=1.7,
wavelet={"type": "ricker", "f0": 5.0},
model={"vp": SEAM_VP}, # vp only, straight from SEG-Y
target_spacing=40.0, # resample 20x10 m -> 40 m
nbl=20, space_order=16, tn=10.0,
freesurface=True,
gradient={'mute': {'type': 'water'}},
preprocess={'mute': {'type': 'direct', 'v': 1.4, 't0': 0.5, 'taper': 100}},
)
model = physics.model
dz = dx = float(model.spacing[0])
n_lateral, n_depth = model.shape
print("completed parameters:", sorted(model._physical_parameters))
print("grid:", model.shape, "spacing (m):", dz)
# -> ['b', 'damp', 'lam', 'mu', 'vp'] (vs -> lam/mu derived, b from Gardner)Cleared operator cache at /Users/mathiaslouboutin/Devitos/devitohorizon/demos/fwi_run/.operator_cache
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(0.0, 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
completed parameters: ['b', 'damp', 'lam', 'mu', 'vp']
grid: (876, 376) spacing (m): 40.0
vs, b and the Lame parameters now exist even though only vp was supplied. Water cells carry no shear (vs = 0) and unit density (b = 1). We plot the velocity with pysegy (depth on the vertical axis).
vp_km = np.asarray(model.vp.data, dtype=np.float32)
pysegy.plot_velocity(vp_km.T, spacing=(dz, dx),
name="SEAM vp (km/s)", units="km")
Model: simulate elastic shots
simulate_shots runs the iso-elastic recipe. We describe the acquisition with Dataset.from_geometry — a fan of sources, a shared receiver spread and nt samples, with no recorded data — and simulate_shots fills it in and hands back populated SeismicData ready for imaging.
rec = np.array([[i * dx, 12.5] for i in range(1, n_lateral - 1)],
dtype=np.float32)
nsrc = 11
src_sp = 1 / (nsrc + 1)
sources = np.array(
[[[(src_sp * (i + 1)) * n_lateral * dx, 12.5]] for i in range(nsrc)],
dtype=np.float32,
)
# A geometry-only acquisition: sources + shared receiver spread + nt.
acquisition = Dataset.from_geometry(sources, rec, dt=4.0, nt=2501)
# simulate_shots fills the acquisition and returns populated SeismicData,
# ready to feed straight into image() — no blanks, no re-wrapping.
imaging = physics.simulate_shots(acquisition) # iso-elastic forward
print("simulated", len(imaging), "elastic shots")Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Non zero shear wave speed at the surface
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Non zero shear wave speed at the surface
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.17 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.30 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.44 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.61 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.71 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.71 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.83 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.60 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.46 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.33 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.18 s
simulated 11 elastic shots
The synthetic shot gather (time on the vertical axis, receivers across) plotted with pysegy.plot_sdata:
gather = imaging[0].data # (nt, n_receivers)
pysegy.plot_sdata(gather, spacing=(imaging[0].dt * 1e-3, dx),
name="Elastic synthetic — shot 0", perc=97, cmap="seismic")
# Show preprocessed data (mute water layer, mute turning waves)
processed = physics.preprocess_data(gather, imaging[0].dt, imaging[0].src_pos,
imaging[0].rec_pos)
pysegy.plot_sdata(processed, spacing=(imaging[0].dt * 1e-3, dx),
name="Elastic processed synthetic for rtm", perc=97, cmap="seismic")
Image: acoustic Z RTM of the elastic data
The same physics object images the elastic data with the acoustic recipe by passing physics="iso-acoustic" for this call only. The construction-time physics governs the model (and its completion); the per-call physics switches only the recipe / imaging condition.
params=("Z",) selects the impedance imaging condition (the ISIC family, mZ/Z). The standard m parameter would instead give the adjoint-consistent slowness gradient.
image = physics.image(imaging, params=("Z",), physics="iso-acoustic")
print("acoustic Z RTM image:", image.shape,
"finite:", bool(np.all(np.isfinite(image))))Prebuilding operators...
Solver FWISolverImpl_HorizonSolver_AcousticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic
Solver FWISolverImpl_HorizonSolver_AcousticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic
Solver FWISolverImpl_HorizonSolver_AcousticIsotropic building operator: JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic
Operators prebuilt and cached successfully
Cropping model in X to [0.000km, 35.000km]
Solver FWISolverImpl_HorizonSolver_AcousticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.15 s
Solver FWISolverImpl_HorizonSolver_AcousticIsotropic building operator: JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.82 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.29 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.97 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.42 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.05 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.50 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.13 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.55 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.16 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.59 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.22 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.63 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.18 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.54 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.14 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.40 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 3.05 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.26 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.97 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.18 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_AcousticIsotropic` ran in 2.82 s
Finalizing reduced gradient with 2 step(s). Surface mute type: water, Global smoothing: False
acoustic Z RTM image: (876, 376) finite: True
pysegy.plot_simage(np.asarray(image).T, spacing=(dz, dx),
name="Acoustic Z RTM", perc=92, units="km")
Why the per-call switch
image, simulate_shot(s), objective and compute_shot_gradient all accept a physics argument that overrides the construction-time recipe for that call and is honored on distributed workers. This lets one configured object model with one physics and image (or invert) with another — here, elastic modeling feeding an acoustic migration — without rebuilding anything.
For multi-parameter inversion (simultaneous vp, epsilon, delta) and per-parameter bounds/scaling, see the Multi-Parameter Inversion example.
Multi-parameter elastic gradient (vp, vs)The elastic physics also computes a multi-parameter gradient — vp andvs in a single adjoint pass. Starting from a smooth model (the true vp/vs,blurred), objective back-projects the data residual onto both velocitiesat once.Two knobs matter here:- save_mode="v" recomputes the forward wavefield during the adjoint, which the shear (vs) gradient needs (the cheap "p" mode only carries the compressional vp term).- freesurface=False: the elastic gradient is currently zero through a free surface in this pipeline, so it is imaged with an absorbing top. We use a dedicated physics — same model, free surface off — and re-model the data so data and gradient are consistent.
from scipy.ndimage import gaussian_filter
from recipes import WaveModel
from devitohorizon.model.grid import interior_array
# Dedicated elastic physics with an absorbing top (no free surface) for the
# multi-parameter gradient. Same SEAM model, save_mode="v" for the vs term.
grad_physics = DevitoPhysics(
physics="iso-elastic", vp_vs_ratio=1.7,
wavelet={"type": "ricker", "f0": 5.0},
model={"vp": SEAM_VP}, target_spacing=40.0,
nbl=20, space_order=16, tn=10.0,
freesurface=False, save_mode="v",
gradient={"mute": {"type": "water"}},
preprocess={"mute": {"type": "direct", "v": 1.4, "t0": 0.5, "taper": 100}},
)
gmodel = grad_physics.model
# Re-model the data with the absorbing-top physics so data and gradient match.
data = grad_physics.simulate_shots(acquisition)
def _interior(fn):
"""Interior (unpadded) array of a model field, or None if it is a scalar."""
arr = np.array(fn.data)
return interior_array(arr, gmodel.padsizes) if arr.ndim else None
# Smooth starting model: blur the true vp/vs so both velocities mismatch.
vp_i, mu_i, b_i = _interior(gmodel.vp), _interior(gmodel.mu), _interior(gmodel.b)
vs_i = np.sqrt(np.maximum(mu_i * (b_i if b_i is not None else 1.0), 0.0))
init_kw = dict(
vp=gaussian_filter(vp_i, 8).astype(np.float32),
vs=gaussian_filter(vs_i, 8).astype(np.float32),
nbl=gmodel.nbl, space_order=gmodel.space_order,
)
if b_i is not None:
init_kw["b"] = b_i.astype(np.float32)
init_model = WaveModel(
shape=gmodel.shape,
spacing=tuple(float(s) for s in gmodel.spacing),
origin=tuple(float(o) for o in gmodel.origin),
**init_kw,
)
# One adjoint pass, both velocities.
misfit, grads = grad_physics.objective(data, model=init_model,
params=("vp", "vs"))
print("misfit:", misfit)
for name, g in grads.items():
nz = bool(np.any(g != 0.0))
print(
f"{name} gradient: shape {g.shape}, "
f"finite {bool(np.all(np.isfinite(g)))}, nonzero {nz}"
)Cleared operator cache at /Users/mathiaslouboutin/Devitos/devitohorizon/demos/fwi_run/.operator_cache
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(0.0, 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.18 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.39 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.54 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.63 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.75 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.84 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.72 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.61 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.52 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.39 s
Cropping model in X to [0.000km, 35.000km]
Detected vp in m/s (max=4800.0), converting to km/s
Loaded model vp, max=4.80, min=1.49, shape=(1751, 1501), origin=(np.float64(0.0), 0)
WaveModel: completed 'iso-elastic' from vp -> ['b', 'vs']
Resampled model from spacing (np.float32(20.0), np.float32(10.0)) to (40.0, 40.0) with shape (876, 376)
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 3.21 s
Prebuilding operators...
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic
Operators prebuilt and cached successfully
Cropping model in X to [0.000km, 35.000km]
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 6.33 s
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.26 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 6.76 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.84 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.22 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 8.16 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.40 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 8.34 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.70 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 8.56 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.49 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 8.53 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.68 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 9.16 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.79 s
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 9.27 s
Cropping model in X to [0.000km, 35.000km]
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
/opt/homebrew/lib/python3.13/site-packages/sympy/matrices/immutable.py:43: SymPyDeprecationWarning:
non-Expr objects in a Matrix is deprecated. Matrix represents
a mathematical matrix. To represent a container of non-numeric
entities, Use a list of lists, TableForm, NumPy array, or some
other data structure instead.
See https://docs.sympy.org/latest/explanation/active-deprecations.html#deprecated-non-expr-in-matrix
for details.
This has been deprecated since SymPy version 1.9. It
will be removed in a future version of SymPy.
return cls._new(*args, **kwargs)
Solver FWISolverImpl_HorizonSolver_ElasticIsotropic building operator: ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.50 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 8.32 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 6.92 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.91 s
Cropping model in X to [0.000km, 35.000km]
Operator `initdamp` ran in 0.01 s
Operator `ForwardFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 6.50 s
Operator `JacobianAdjFWISolverImpl_HorizonSolver_ElasticIsotropic` ran in 7.55 s
Finalizing reduced gradient with 2 step(s). Surface mute type: water, Global smoothing: True
Applying Gaussian smoothing to gradient with sigma=(1, 1)
misfit: 415.8284355326032
vp gradient: shape (876, 376), finite True, nonzero True
vs gradient: shape (876, 376), finite True, nonzero True
for name in ("vp", "vs"):
pysegy.plot_simage(
np.asarray(grads[name]).T, spacing=(dz, dx),
name=f"Elastic {name} gradient", perc=92, units="km",
)
