pygimli.manager

Method manager templates.

Overview

Classes

MeshMethodManager(**kwargs) Method Manager base class for managers using a (non-1D) mesh.
MethodManager([verbose, debug]) General manager to maintenance a measurement method.
MethodManager1d(**kwargs) Method Manager base class for managers on a 1d discretization.

Classes

MeshMethodManager

class pygimli.manager.MeshMethodManager(**kwargs)[source]

Method Manager base class for managers using a (non-1D) mesh.

Methods

apparentData() Convert data into apparent data.
checkData() Check data validity.
createArgParser([dataSuffix]) Create argument parser for the manager.
createData(sensors, scheme) Create an empty data set.
createFOP_([verbose]) Create forward operator working on refined mesh.
createInv_(fop[, verbose, dosave]) Create inversion instance, data- and model transformations.
createMesh(**kwargs) Create a mesh aka the parametrization.
dataToken() Token name for the data in a DataContainer.
estimateError(data[, absoluteError, …]) Estimate error composed of an absolute and a relative part.
invert([data, vals, err, mesh]) Run the full inversion.
model() Return the actual model.
saveResult([folder, size]) Save results in the specified folder.
setData(data) Set data container from outside.
setDataToken(token) Set the token name to identity the data in a DataContainer.
setMesh(mesh[, refine]) Set the internal mesh for this Manager.
setVerbose(verbose) Make the class verbose (put output to the console)
show(data[, values, axes, cMin, cMax, colorBar]) Forward the visualization.
showData([axes, response, name]) Show data.
showMesh([ax]) Show mesh in given axes or in a new figure.
showResult([ax, cMin, cMax, logScale]) Show resulting vector.
simulate(**kwargs) Run a simulation aka the forward task.
__init__(**kwargs)[source]

Constructor.

apparentData()

Convert data into apparent data.

checkData()

Check data validity.

static createArgParser(dataSuffix='dat')[source]

Create argument parser for the manager.

createData(sensors, scheme)

Create an empty data set.

createFOP_(verbose=False)

Create forward operator working on refined mesh.

createInv_(fop, verbose=True, dosave=False)

Create inversion instance, data- and model transformations.

createMesh(**kwargs)[source]

Create a mesh aka the parametrization.

dataToken()

Token name for the data in a DataContainer.

static estimateError(data, absoluteError=0.001, relativeError=0.001)

Estimate error composed of an absolute and a relative part.

invert(data=None, vals=None, err=None, mesh=None, **kwargs)[source]

Run the full inversion.

The data and error needed to be set before. The meshes will be created if necessary.

DOCUMENTME!!!

Parameters:
lam : float [20]

regularization parameter

zWeight : float [0.7]

relative vertical weight

maxIter : int [20]

maximum iteration number

robustdata : bool [False]

robust data reweighting using an L1 scheme (IRLS reweighting)

blockymodel : bool [False]

blocky model constraint using L1 reweighting roughness vector

startModelIsReference : bool [False]

startmodel is the reference model for the inversion

forwarded to createMesh
depth
quality
paraDX
maxCellArea
model()

Return the actual model.

saveResult(folder=None, size=(16, 10), **kwargs)

Save results in the specified folder.

setData(data)[source]

Set data container from outside.

setDataToken(token)

Set the token name to identity the data in a DataContainer.

setMesh(mesh, refine=True)[source]

Set the internal mesh for this Manager.

Inject the mesh in the internal fop und inv.

Initialize RegionManager. For more than two regions the first is assumed to be background.

Optional the forward mesh can be refined for higher numerical accuracy.

Parameters:
DOCUMENTME!!!
setVerbose(verbose)

Make the class verbose (put output to the console)

show(data, values=None, axes=None, cMin=None, cMax=None, colorBar=1, **kwargs)

Forward the visualization.

showData(axes=None, response=None, name='data')

Show data.

showMesh(ax=None)[source]

Show mesh in given axes or in a new figure.

showResult(ax=None, cMin=None, cMax=None, logScale=False, **kwargs)

Show resulting vector.

simulate(**kwargs)

Run a simulation aka the forward task.

MethodManager

class pygimli.manager.MethodManager(verbose=True, debug=False)[source]

General manager to maintenance a measurement method.

The method manager holds one instance of a forward operator and a appropriate inversion method to handle simulation and reconstruction of common geophysical problems.

Methods

apparentData() Convert data into apparent data.
checkData() Check data validity.
createArgParser([dataSuffix]) Create default argument parser.
createData(sensors, scheme) Create an empty data set.
createFOP_([verbose]) Create forward operator working on refined mesh.
createInv_(fop[, verbose, dosave]) Create inversion instance, data- and model transformations.
dataToken() Token name for the data in a DataContainer.
estimateError(data[, absoluteError, …]) Estimate error composed of an absolute and a relative part.
invert(**kwargs) Invert the data and fill the parametrization.
model() Return the actual model.
saveResult([folder, size]) Save results in the specified folder.
setData(data) Set data.
setDataToken(token) Set the token name to identity the data in a DataContainer.
setVerbose(verbose) Make the class verbose (put output to the console)
show(data[, values, axes, cMin, cMax, colorBar]) Forward the visualization.
showData([axes, response, name]) Show data.
showResult([ax, cMin, cMax, logScale]) Show resulting vector.
simulate(**kwargs) Run a simulation aka the forward task.
__init__(verbose=True, debug=False)[source]

Constructor.

apparentData()[source]

Convert data into apparent data.

checkData()[source]

Check data validity.

static createArgParser(dataSuffix='dat')[source]

Create default argument parser.

Create default argument parser for the following options:

-Q, –quiet

-R, –robustData: options.robustData

-B, –blockyModel: options.blockyModel

-l, –lambda: options.lam

-i, –maxIter: options.maxIter

—depth: options.depth

createData(sensors, scheme)[source]

Create an empty data set.

createFOP_(verbose=False)[source]

Create forward operator working on refined mesh.

createInv_(fop, verbose=True, dosave=False)[source]

Create inversion instance, data- and model transformations.

dataToken()[source]

Token name for the data in a DataContainer.

static estimateError(data, absoluteError=0.001, relativeError=0.001)[source]

Estimate error composed of an absolute and a relative part.

invert(**kwargs)[source]

Invert the data and fill the parametrization.

model()[source]

Return the actual model.

saveResult(folder=None, size=(16, 10), **kwargs)[source]

Save results in the specified folder.

setData(data)[source]

Set data.

setDataToken(token)[source]

Set the token name to identity the data in a DataContainer.

setVerbose(verbose)[source]

Make the class verbose (put output to the console)

show(data, values=None, axes=None, cMin=None, cMax=None, colorBar=1, **kwargs)[source]

Forward the visualization.

showData(axes=None, response=None, name='data')[source]

Show data.

showResult(ax=None, cMin=None, cMax=None, logScale=False, **kwargs)[source]

Show resulting vector.

simulate(**kwargs)[source]

Run a simulation aka the forward task.

MethodManager1d

class pygimli.manager.MethodManager1d(**kwargs)[source]

Method Manager base class for managers on a 1d discretization.

Attributes:
debug
verbose

Methods

createArgParser([dataSuffix]) Create default argument parser.
createForwardOperator([verbose]) Mandatory interface for derived classes.
estimateError(data[, errLevel]) Estimate data error.
initForwardOperator(**kwargs) Initialize or re-initialize the forward operator.
initInversionFramework(**kwargs) Initialize or re-initialize the inversion framework.
invert([dataVals, errVals]) Invert the data.
loadData(filename, **kwargs) Mandatory interface for derived classes.
setVerbose(verbose) Make the class verbose (put output to the console)
showData(data[, error, ax]) Shows the data.
showFit([ax]) Show the last inversion date and response.
showModel(model[, ax]) Shows a model.
showResult([ax]) Show the last inversion result.
showResultAndFit() Calls showResults and showFit.
simulate(model, **kwargs) Run a simulation aka the forward task.
createInversionFramework  
__init__(**kwargs)[source]

Constructor.

static createArgParser(dataSuffix='dat')

Create default argument parser.

Create default argument parser for the following options:

-Q, –quiet

-R, –robustData: options.robustData

-B, –blockyModel: options.blockyModel

-l, –lambda: options.lam

-i, –maxIter: options.maxIter

—depth: options.depth

createForwardOperator(verbose=False, **kwargs)

Mandatory interface for derived classes.

Here you need to specify which kind of forward operator FOP you want to use. This is called by any initForwardOperator() call.

Parameters:
**kwargs

Any arguments that are necessary for your FOP creation.

Returns:
Modelling

Instance of any kind of pygimli.framework.Modelling.

createInversionFramework(**kwargs)[source]
debug
estimateError(data, errLevel=0.01)

Estimate data error.

Create an error of estimated measurement error. On default it returns an array of constant relative errors. More sophisticated error estimation should be done in specialized derived classes.

Parameters:
data : iterable

Data values for which the errors should be estimated.

errLevel : float (0.01)

Error level in percent/100.

Returns:
err : array

Returning array of size len(data)

initForwardOperator(**kwargs)

Initialize or re-initialize the forward operator.

Called once in the constructor to force the manager to create the necessary forward operator member. Can be recalled if you need to changed the mangers own forward operator object. If you want a own instance of a valid FOP call createForwardOperator.

initInversionFramework(**kwargs)

Initialize or re-initialize the inversion framework.

Called once in the constructor to force the manager to create the necessary Framework instance.

invert(dataVals=None, errVals=None, **kwargs)

Invert the data.

Invert the data values by calling self.inv.run() with mandatory data and error values.

Parameters:
dataVals : iterable

Data values to be inverted.

errVals : iterable | float

Error value for the given data. If errVals is float we assume this means to be a global relative error and force self.estimateError to be called.

loadData(filename, **kwargs)

Mandatory interface for derived classes.

setVerbose(verbose)

Make the class verbose (put output to the console)

showData(data, error=None, ax=None, **kwargs)

Shows the data.

Draw data values into a given axes or show the data values from the last run. Forwards on default to the self.fop.drawData function of the modelling operator. If there is no given function given, you have to override this method.

Parameters:
ax : mpl axes

Axes object to draw into. Create a new if its not given.

data : iterable

Data values to be draw.

error : iterable

Data error values to be draw.

showFit(ax=None)

Show the last inversion date and response.

showModel(model, ax=None, **kwargs)

Shows a model.

Draw model date into a given axes or show the inversion result from the last run. Forwards on default to the self.fop.drawModel function of the modelling operator. If there is no given function given, you have to override this method.

Parameters:
ax : mpl axes

Axes object to draw into. Create a new if its not given.

model : iterable

Model data to be draw.

showResult(ax=None, **kwargs)

Show the last inversion result.

showResultAndFit()

Calls showResults and showFit.

simulate(model, **kwargs)

Run a simulation aka the forward task.

verbose


2019 - GIMLi Development Team
Created using Bootstrap, Sphinx and pyGIMLi 1.0.11+23.g5fafebb7 on May 23, 2019.