Basic DC resistivity inversion

In this tutorial, we will see how to use ResIPy API to analyse the field data shown in Figure 5.1.

In [1]:
from resipy import R2
k = R2(typ='R2')
C:\Program Files (x86)\WPy64-3770\python-3.7.7.amd64\lib\site-packages\pyvista\core\pyvista_ndarray.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
  from collections import Iterable
API path =  C:\Program Files (x86)\WPy64-3770\python-3.7.7.amd64\lib\site-packages\resipy
ResIPy version =  2.2.2
cR2.exe found and up to date.
R3t.exe found and up to date.
cR3t.exe found and up to date.
Working directory is: C:\Program Files (x86)\WPy64-3770\python-3.7.7.amd64\lib\site-packages\resipy
clearing dirname
In [2]:
k.createSurvey(r'C:\ResIPy\Notebook examples\Basic DC resistivity inversion\All_data.dat', ftype='ProtocolDC')
1448/1466 reciprocal measurements found.
0 measurements error > 20 %
In [3]:
k.showError()
In [4]:
k.fitErrorPwl()
Error model is R_err = 0.002 R_avg^0.692 (R^2 = 0.881)
In [5]:
k.importElec(r'C:\ResIPy\Notebook examples\Basic DC resistivity inversion\electrodes.csv')
In [6]:
k.showPseudo()
In [7]:
k.createMesh(typ='trian')
k.showMesh()
Creating triangular mesh...Reading mesh.msh
Gmsh version == 3.x
reading node coordinates...
Determining element type...Triangle
Reading connection matrix...
ignoring 0 elements in the mesh file, as they are not required for R2/R3t
Finished reading .msh file
ResIPy Estimated RAM usage = 0.045903 Gb
done
In [8]:
k.err = True # setting this flag is necessary for adopting the fitted error model, otherwise a default error is set
k.invert()
Writing .in file and protocol.dat... done!
--------------------- MAIN INVERSION ------------------


 >> R  2    R e s i s t i v i t y   I n v e r s i o n   v4.0 <<

 >> D a t e : 18 - 08 - 2020
 >> My beautiful survey                                                             
 >> I n v e r s e   S o l u t i o n   S e l e c t e d <<
 >> Determining storage needed for finite element conductance matrix
 >> Generating index array for finite element conductance matrix
 >> Reading start resistivity from res0.dat                      
 >> R e g u l a r i s e d   T y p e <<
 >>   L i n e a r    F i l t e r    <<
 >> L o g - D a t a   I n v e r s i o n <<
 >> N o r m a l   R e g u l a r i s a t i o n <<
 >> D a t a   w e i g h t s   w i l l   b e  m o d i f i e d <<
 >> D a t a   w e i g h t   t o   b e   r e a d   f r o m   d a t a   f i l e <<


 Processing dataset   1


 Measurements read:   742     Measurements rejected:     0
   Geometric mean of apparent resistivities:  0.31461E+03

 >> Total Memory required is:          0.301 Gb

   Iteration   1
     Initial RMS Misfit:       195.15       Number of data ignored:     0
     Alpha:       16457.609   RMS Misfit:       12.93  Roughness:       10.113
     Alpha:        7638.946   RMS Misfit:       12.65  Roughness:       15.188
     Alpha:        3545.684   RMS Misfit:       14.46  Roughness:       20.495
     Step length set to   1.00000
     Final RMS Misfit:       12.65
     Updated data weights

   Iteration   2
     Initial RMS Misfit:         8.93       Number of data ignored:     0
     Alpha:        4760.654   RMS Misfit:        5.23  Roughness:       12.556
     Alpha:        2209.700   RMS Misfit:        3.46  Roughness:       16.009
     Alpha:        1025.652   RMS Misfit:        2.43  Roughness:       18.902
     Alpha:         476.065   RMS Misfit:        1.87  Roughness:       21.529
     Alpha:         220.970   RMS Misfit:        1.60  Roughness:       24.368
     Alpha:         102.565   RMS Misfit:        1.55  Roughness:       27.691
     Alpha:          47.607   RMS Misfit:        1.65  Roughness:       31.448
     Step length set to   1.00000
     Final RMS Misfit:        1.55
     Updated data weights

   Iteration   3
     Initial RMS Misfit:         1.09       Number of data ignored:     0
     Alpha:          51.709   RMS Misfit:        0.74  Roughness:       28.380
     Step length set to   1.00000
     Final RMS Misfit:        0.74
     Final RMS Misfit:        1.00

 Solution converged - Outputing results to file

 Calculating sensitivity map


 Processing dataset   2


 End of data:  Terminating
1/1 results parsed (1 ok; 0 failed)
In [9]:
k.showResults(contour=True, sens=False, zlim=[-20,20], color_map='jet')
In [10]:
k.showPseudoInvError(vmin=-3, vmax=3) # the range is set as -3 to 3
In [ ]: