|
9 | 9 | - 2D inversion with topography |
10 | 10 | - geometric factor generation |
11 | 11 | - topography effect |
| 12 | +
|
| 13 | +The data is the profile 11 already shown by Günther et al. (2006, Fig. 11). |
12 | 14 | """ |
13 | | -# sphinx_gallery_thumbnail_number = 5 |
| 15 | +# sphinx_gallery_thumbnail_number = 7 |
| 16 | +import matplotlib.pyplot as plt |
14 | 17 | import pygimli as pg |
15 | 18 | from pygimli.physics import ert |
16 | 19 |
|
|
21 | 24 | data = pg.getExampleData('ert/slagdump.ohm', verbose=True) |
22 | 25 | print(data) |
23 | 26 |
|
| 27 | +############################################################################### |
| 28 | +# Let us first have a look at the topography contained in the data |
| 29 | +plt.plot(pg.x(data), pg.z(data), 'x-') |
| 30 | + |
24 | 31 | ############################################################################### |
25 | 32 | # The data file does not contain geometric factors (token field 'k'), |
26 | 33 | # so we create them based on the given topography. |
| 34 | +k0 = ert.createGeometricFactors(data) # the analytical one |
27 | 35 | data['k'] = ert.createGeometricFactors(data, numerical=True) |
28 | 36 |
|
29 | | -############################################################################### |
30 | | -# We initialize the ERTManager for further steps and eventually inversion. |
31 | | -mgr = ert.ERTManager(sr=False) |
32 | | - |
33 | 37 | ############################################################################### |
34 | 38 | # It might be interesting to see the topography effect, i.e the ratio between |
35 | | -# the numerically computed geometry factor and the analytical formula |
36 | | -k0 = ert.createGeometricFactors(data) |
37 | | -_ = ert.showData(data, vals=k0/data['k'], label='Topography effect') |
| 39 | +# the numerically computed geometry factor and the analytical formula after |
| 40 | +# Rücker et al. (2006). We display it using a colormap with neutral white. |
| 41 | +_ = ert.showData(data, vals=k0/ data['k'], label='Topography effect', |
| 42 | + cMin=2/3, cMax=3/2, logScale=True, cMap="bwr") |
38 | 43 |
|
39 | 44 | ############################################################################### |
40 | | -# The data container has no apparent resistivities (token field 'rhoa') yet. |
41 | | -# We can let the Manager fix this later for us (as we now have the 'k' field), |
42 | | -# or we do it manually. |
43 | | -mgr.checkData(data) |
44 | | -print(data) |
| 45 | +# We can now compute the apparent resistivity and display it, once with the |
| 46 | +# wrong analytical formula and once with the numerical values in data['k'] |
| 47 | +data['rhoa'] = data['r'] * data['k'] |
| 48 | +kw = dict(cMin=6, cMax=33) |
| 49 | +fig, ax = plt.subplots(ncols=2) |
| 50 | +data.show(data['r']*k0, ax=ax[0], **kw); |
| 51 | +data.show(ax=ax[1], **kw) |
| 52 | +ax[0].set_title('Uncorrected') |
| 53 | +ax[1].set_title('Corrected'); |
45 | 54 |
|
46 | 55 | ############################################################################### |
47 | 56 | # The data container does not necessarily contain data errors data errors |
48 | 57 | # (token field 'err'), requiring us to enter data errors. We can let the |
49 | 58 | # manager guess some defaults for us automaticly or set them manually |
50 | | -data['err'] = ert.estimateError(data, relativeError=0.03, absoluteUError=5e-5) |
51 | | -# or manually: |
52 | | -# data['err'] = data_errors # somehow |
53 | | -_ = ert.show(data, data['err']*100) |
| 59 | +data.estimateError(relativeError=0.03, absoluteUError=5e-5) |
| 60 | +# which internally calls |
| 61 | +# data['err'] = ert.estimateError(data, ...) # can also set manually |
| 62 | +_ = data.show(data['err']*100, label='error estimate (%)') |
| 63 | + |
| 64 | +############################################################################### |
| 65 | +# We initialize the ERTManager for further steps and eventually inversion. |
| 66 | +mgr = ert.ERTManager(data) |
54 | 67 |
|
55 | 68 | ############################################################################### |
56 | 69 | # Now the data have all necessary fields ('rhoa', 'err' and 'k') so we can run |
|
59 | 72 | # |
60 | 73 | mod = mgr.invert(data, lam=10, verbose=True, |
61 | 74 | paraDX=0.3, paraMaxCellSize=10, paraDepth=20, quality=33.6) |
62 | | - |
63 | | -_ = mgr.showResult() |
| 75 | +ax, cb = mgr.showResult() |
64 | 76 |
|
65 | 77 | ############################################################################### |
66 | 78 | # We can view the resulting model in the usual way. |
|
69 | 81 |
|
70 | 82 | ############################################################################### |
71 | 83 | # Or just plot the model only using your own options. |
72 | | -_ = mgr.showResult(mod, cMin=5, cMax=30, cMap="Spectral_r", logScale=True) |
| 84 | +ax, cb = mgr.showResult(mod, cMin=5, cMax=30, cMap="Spectral_r", logScale=True) |
0 commit comments