#!/usr/bin/env python # coding: utf-8 # # Batch inversion # Batch inversion is the fact to allow to invert multiple surveys in once. Here we reuse a lot of stuff from the time-lapse implementation. # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') import warnings warnings.filterwarnings('ignore') import os import sys import matplotlib.pyplot as plt sys.path.append((os.path.relpath('../src/'))) # add here the relative path of the API folder testdir = '../src/examples/dc-2d-timelapse/' from resipy import Project # In[2]: k = Project(typ='R2') k.createBatchSurvey(testdir + 'data/') # In[3]: fig, ax = plt.subplots() k.fitErrorPwl(ax=ax) # And inversion as usual. # In[4]: k.invert(parallel=True) # as for time-lapse, we can run the inversion in parallel # (this will makes the live outputs a bit funny but should be faster overall.) # And each inverted section can be shown using the same function `R2.showResults()`. # In[5]: k.showResults(index=0, vmin=1.5, vmax=2) k.showResults(index=1, vmin=1.5, vmax=2) k.showResults(index=2, vmin=1.5, vmax=2) # In[ ]: