ertkit.ves.invert_smooth#
- ertkit.ves.invert_smooth(data, *, n_layers=30, depth_range=None, depth_of_investigation=True, max_iter=30)#
Smooth (Occam) inversion with sensitivity and depth of investigation.
- Parameters:
- dataSounding
The data and their error model.
- n_layersint, optional
Number of layers, including the bottom half-space. At least 3, so that distinct first and last interfaces span
depth_range. Default 30. Useinvert_few_layer()for a two-layer fit.- depth_range(float, float), optional
Depths in meters of the first and last layer interfaces, which are spaced logarithmically. Default: 0.3 times the smallest and 3 times the largest AB/2.
- depth_of_investigationbool, optional
Also compute the Oldenburg and Li depth of investigation (two further inversions). Default True.
- max_iterint, optional
Maximum number of Occam iterations. Default 30.
- Returns:
- SmoothFit
- Raises:
- TypeError
If
datais not aSounding.- ValueError
If
n_layersis less than 3,max_iteris less than 1, ordepth_rangeis invalid.
- Warns:
- ConvergenceWarning
If the iterations stop before the model is stable, or a reference inversion for the depth of investigation does not converge.
- DataWarning
If even the smallest misfit is improbably large (goodness-of-fit p-value below 0.01: the errors may be underestimated), if even the smoothest model fits better than the target (the errors may be overestimated), or if the depth of investigation cannot be determined (extend
depth_range).
Notes
The method is Occam’s inversion (Constable et al. 1987). If no model reaches \(\chi^2 = N_d\) (which happens for a few percent of soundings even with correct errors), the inversion targets 1.1 times the smallest misfit instead, recorded in
chi2_target. Thestop_reasonsays whether this relaxed target was reached, the smoothest model already fits better, or the target remains unreachable. A poor-fit warning is issued only if the smallest misfit is improbably large.The depth of investigation follows Oldenburg and Li (1999), with reference models of 0.1 and 10 times the geometric mean apparent resistivity (a factor of 100 apart) that aim at the same misfit. The module documentation gives the details.
Examples
>>> import numpy as np >>> from ertkit.ves import LayeredModel, Sounding, Survey, invert_smooth >>> truth = LayeredModel(resistivity=[150.0, 30.0, 800.0], thickness=[2.0, 15.0]) >>> survey = Survey.schlumberger(ab2=np.geomspace(2.5, 200.0, 22), mn2=0.5) >>> smooth = invert_smooth(Sounding.synthetic(truth, survey, rng=5)) >>> smooth.model.n_layers, smooth.converged (30, True)