#!/usr/bin/env python # coding: utf-8 # Cross-Borehole example # ====================== # In this example we are going to invert one of the example given in the R2 manual. The aim is to detect a hidden block # in the bottom left of the picture as shown below: # and this pictures: # # ![Xhb.png](./img/Xbh.png) # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') import warnings warnings.filterwarnings('ignore') import os import sys import numpy as np # just for parsing the electrode position file sys.path.append((os.path.relpath('../src'))) # add here the relative path of the API folder testdir = '../src/examples/dc-2d-borehole/' from resipy import Project # Then we will import the `protocol.dat` file that was outputed by the forward model with this geometry and invert it. Note what we also need to import the electrodes position from a .csv file with 3 columns:x, y, buried. The `buried` column contains 1 if the electrode is buried and 0 if not. # In[2]: k = Project(typ='R2') k.createSurvey(testdir + 'protocol.dat', ftype='ProtocolDC') k.importElec(testdir + 'elec.csv') k.createMesh('trian', cl=0.5, cl_factor=20, fmd=20) # cl is characteristic length, it defines the resolution of the mesh around the electrodes, the smaller, the finer # cl_factor is how the mesh will grow away from the electrode # NOTE that a too fine mesh (very small cl) will takes a lot of RAM # but a too coarse mesh won't be able to resolve the target k.zlim = [-20, 0] k.showMesh() k.invert() k.showResults(sens=False, contour=True) # In[ ]: