pygimli.physics.em

Frequency-domain (FD) or time-domain (TD) semi-analytical 1d solutions

Overview

Functions

importMaxminData(filename[, verbose]) Import function reading in positions, data, frequencies, geometry.
readusffile(filename[, data]) Read data from single USF (universal sounding file) file.
rhoafromB(B, t, Tx[, current]) Apparent resistivity from B-field TEM
rhoafromU(U, t, Tx[, current, Rx]) Apparent resistivity curve from classical TEM (U or dB/dt)

Classes

FDEM([x, freqs, coilSpacing, inphase, …]) Class for managing Frequency Domain EM data and their inversions.
HEMmodelling(nlay, height[, f, r]) HEM Airborne modelling class based on the BGR RESOLVE system.
TDEM([filename]) TEM class mainly for holding data etc.

Functions

importMaxminData

pygimli.physics.em.importMaxminData(filename, verbose=False)[source]

Import function reading in positions, data, frequencies, geometry.

readusffile

pygimli.physics.em.readusffile(filename, data=None)[source]

Read data from single USF (universal sounding file) file.

data = readusffile( filename ) data = readusffile( filename, data ) will append to data

rhoafromB

pygimli.physics.em.rhoafromB(B, t, Tx, current=1)[source]

Apparent resistivity from B-field TEM

\[\rho_a = ( (A_{Tx}*I*\mu_0 ) / (30B) )^2/3 * 4e-7 / t\]

rhoafromU

pygimli.physics.em.rhoafromU(U, t, Tx, current=1.0, Rx=None)[source]

Apparent resistivity curve from classical TEM (U or dB/dt)

rhoafromU(U/I, t, TXarea[, RXarea])

\[\rho_a = ( A_{Rx} *A_{Tx} * \mu_0 / 20 / (U/I) )^2/3*t^{-5/3}*4e-7\]

Classes

FDEM

class pygimli.physics.em.FDEM(x=None, freqs=None, coilSpacing=None, inphase=None, outphase=None, filename=None, scaleFreeAir=False)[source]

Class for managing Frequency Domain EM data and their inversions.

Methods

FOP([nlay]) Forward modelling operator using a block discretization.
FOP2d(nlay) 2d forward modelling operator.
FOPsmooth(zvec) Forward modelling operator using fixed layers (smooth inversion)
datavec([xpos]) Extract data vector (stack in and out phase) for given pos/no.
deactivate(fr) Deactivate a single frequency.
error([xpos]) Return error as vector.
errorvec([xpos, minvalue]) Extract error vector for a give position or sounding number.
freq() Return active (i.e., non-deactivated) frequencies.
importEmsysAsciiData(filename) Import data from emsys text export file.
importMaxminData(filename[, verbose]) Import MaxMin IPX format with pos, data, frequencies & geometry.
inv2D(nlay[, lam, resL, resU, thkL, thkU, …]) 2d LCI inversion class.
invBlock([xpos, nlay, noise, stmod, lam, …]) Create and return Gimli inversion instance for block inversion.
plotAllData([orientation, aspect, outname, …]) Plot data along a profile as image plots for IP and OP.
plotData([xpos, response, error, ax, …]) Plot data as curves at given position.
plotDataOld([xpos, response, marker, …]) Plot data as curves at given position.
plotModelAndData(model, xpos, response[, …]) Plot both model and data in subfigures.
readHEMData(filename[, takeevery, choosevcp]) Read RESOLVE type airborne EM data from .XYZ file.
selectData([xpos]) Select sounding at a specific position or by number.
showModelAndData(model[, xpos, response, …]) Show both model and data with response in subfigures.
FOP(nlay=2)[source]

Forward modelling operator using a block discretization.

Parameters:
nlay : int

Number of blocks

FOP2d(nlay)[source]

2d forward modelling operator.

FOPsmooth(zvec)[source]

Forward modelling operator using fixed layers (smooth inversion)

Parameters:
zvec : array
__init__(x=None, freqs=None, coilSpacing=None, inphase=None, outphase=None, filename=None, scaleFreeAir=False)[source]

Initialize data class and load data. Provide filename or data.

If filename is given, data is loaded, overwriting settings.

Parameters:
x: array

Array of measurement positions

freq: array

Measured frequencies

coilSpacing : float

Distance between 2 two coils

inphase : array

real part of \(|amplitude| * \exp^{i phase}\)

outphase : array

imaginary part of \(|amplitude| * \exp^{i phase}\)

filename : str

Filename to read from. Supported: .xyz (MaxMin), *.txt (Emsys)

scaleFreeAir : bool

Scale inphase and outphase data by free air (primary) solution

datavec(xpos=0)[source]

Extract data vector (stack in and out phase) for given pos/no.

deactivate(fr)[source]

Deactivate a single frequency.

error(xpos=0)[source]

Return error as vector.

errorvec(xpos=0, minvalue=0.0)[source]

Extract error vector for a give position or sounding number.

freq()[source]

Return active (i.e., non-deactivated) frequencies.

importEmsysAsciiData(filename)[source]

Import data from emsys text export file.

columns: no, pos(1-3), separation(4), frequency(6), error(8), inphase (9-11), outphase (12-14), reads: positions, data, frequencies, error and geometry

importMaxminData(filename, verbose=False)[source]

Import MaxMin IPX format with pos, data, frequencies & geometry.

inv2D(nlay, lam=100.0, resL=1.0, resU=1000.0, thkL=1.0, thkU=100.0, minErr=1.0)[source]

2d LCI inversion class.

invBlock(xpos=0, nlay=2, noise=1.0, stmod=30.0, lam=100.0, lBound=0.0, uBound=0.0, verbose=False)[source]

Create and return Gimli inversion instance for block inversion.

Parameters:
xpos : array

position vector

nLay : int

Number of layers of the model to be determined OR vector of layer numbers OR forward operator

noise : float

Absolute data err in percent

stmod : float or pg.RVector

Starting model

lam : float

Global regularization parameter lambda.

lBound : float

Lower boundary for the model

uBound : float

Upper boundary for the model. 0 means no upper booundary

verbose : bool

Be verbose

plotAllData(orientation='horizontal', aspect=1000, outname=None, show=False, figsize=(11, 6), everyx=1)[source]

Plot data along a profile as image plots for IP and OP.

plotData(xpos=0, response=None, error=None, ax=None, marker='bo-', rmarker='rx-', clf=True, addlabel='', nv=2)[source]

Plot data as curves at given position.

plotDataOld(xpos=0, response=None, marker='bo-', rmarker='rx-', clf=True)[source]

Plot data as curves at given position.

plotModelAndData(model, xpos, response, modelL=None, modelU=None)[source]

Plot both model and data in subfigures.

readHEMData(filename, takeevery=1, choosevcp=True)[source]

Read RESOLVE type airborne EM data from .XYZ file.

selectData(xpos=0)[source]

Select sounding at a specific position or by number.

Retrieve inphase, outphase and error(if exist) vector from index or near given position

Returns:
IP : array OP : array ERR : array or None (if no error is specified)
showModelAndData(model, xpos=0, response=None, figsize=(8, 6))[source]

Show both model and data with response in subfigures.

HEMmodelling

class pygimli.physics.em.HEMmodelling(nlay, height, f=None, r=None, **kwargs)[source]

HEM Airborne modelling class based on the BGR RESOLVE system.

Methods

__call__((object)arg1, (object)model) C++ signature :
calc_forward(x, h, rho, d, epr, mur[, …]) Calculate forward response.
clearConstraints((object)arg1) C++ signature :
clearJacobian((object)arg1) C++ signature :
constraints((object)arg1) C++ signature :
constraintsRef((object)arg1) C++ signature :
createConstraints((object)arg1) C++ signature :
createDefaultStartModel((object)arg1) C++ signature :
createJacobian((object)arg1, (object)model) C++ signature :
createMappedModel((object)arg1, …) Read only extrapolation of model values given per cell marker to values given per cell.
createRefinedForwardMesh((object)arg1 [, …) C++ signature :
createStartModel((object)arg1) C++ signature :
createStartVector((object)arg1) DEPRECATED use createStartModel
data((object)arg1) Return the associated data container.
deleteMesh((object)arg1) Delete the actual mesh.
downward(rho, d, z, epr, mur, lam) Downward continuation of fields.
initConstraints((object)arg1) C++ signature :
initJacobian((object)arg1) C++ signature :
initRegionManager((object)arg1) C++ signature :
jacobian((object)arg1) Return the pointer to the Jacobian matrix associated with this forward operator.
jacobianRef((object)arg1) C++ signature :
mapModel((object)arg1, (object)model [, …) C++ signature :
mesh((object)arg1) C++ signature :
multiThreadJacobian((object)arg1) Return number of threads used for Jacobian generation.
region((object)arg1, (object)marker) Syntactic sugar for this->regionManager().region(marker).
regionManager((object)arg1) C++ signature :
regionManagerRef((object)arg1) C++ signature :
response(par) Compute response vector by pasting in-phase and out-phase data.
response_mt((object)arg1, (object)model [, …) C++ signature :
setConstraints((object)arg1, (object)C) C++ signature :
setData((object)arg1, (object)data) Change the associated data container
setJacobian((object)arg1, (object)J) C++ signature :
setMesh((object)arg1, (object)mesh [, …) Set new mesh to the forward operator, optionally hold region parameter for the new mesh (i.e.
setMultiThreadJacobian((object)arg1, …) Set number of threads used for brute force Jacobian generation.
setRegionManager((object)arg1, (object)reg) C++ signature :
setStartModel((object)arg1, (object)startModel) C++ signature :
setThreadCount((object)arg1, (object)nThreads) Set the maximum number of allowed threads for MT calculation.
setVerbose((object)arg1, (object)verbose) Set verbose state.
solution((object)arg1) C++ signature :
startModel((object)arg1) C++ signature :
threadCount((object)arg1) Return the maximum number of allowed threads for MT calculation
verbose((object)arg1) Get verbose state.
vmd_hem(h, rho, d[, epr, mur, quasistatic]) Vertical magnetic dipole (VMD) response.
vmd_total_Ef(h, z, rho, d, epr, mur, tm) VMD E-phi field (not used actively).
createJacobian_mt  
responses  
__init__(nlay, height, f=None, r=None, **kwargs)[source]

Initialize class with geometry

Parameters:
nlay : int

number of layers

height : float

helicopter

f : array [BGR RESOLVE system 387Hz-133kHz]

frequency vector

r : array [BGR RESOLVE system 7.91-7.94]

distance vector

scaling : float

scaling factor or string (ppm=1e6, percent=1e2)

c0 = 299792251.7596404
calc_forward(x, h, rho, d, epr, mur, quasistatic=False)[source]

Calculate forward response.

clearConstraints((object)arg1) → object :
C++ signature :
void* clearConstraints(GIMLI::ModellingBase {lvalue})

clearConstraints( (object)arg1) -> object :

C++ signature :
void* clearConstraints(ModellingBase_wrapper {lvalue})
clearJacobian((object)arg1) → object :
C++ signature :
void* clearJacobian(GIMLI::ModellingBase {lvalue})

clearJacobian( (object)arg1) -> object :

C++ signature :
void* clearJacobian(ModellingBase_wrapper {lvalue})
constraints((object)arg1) → object :
C++ signature :
GIMLI::MatrixBase* constraints(GIMLI::ModellingBase {lvalue})

constraints( (object)arg1) -> object :

C++ signature :
GIMLI::MatrixBase* constraints(ModellingBase_wrapper {lvalue})

constraints( (object)arg1) -> object :

C++ signature :
GIMLI::MatrixBase* constraints(GIMLI::ModellingBase {lvalue})

constraints( (object)arg1) -> object :

C++ signature :
GIMLI::MatrixBase* constraints(ModellingBase_wrapper {lvalue})
constraintsRef((object)arg1) → object :
C++ signature :
GIMLI::SparseMapMatrix<double, unsigned long> {lvalue} constraintsRef(GIMLI::ModellingBase {lvalue})

constraintsRef( (object)arg1) -> object :

C++ signature :
GIMLI::SparseMapMatrix<double, unsigned long> {lvalue} constraintsRef(GIMLI::ModellingBase {lvalue})
createConstraints((object)arg1) → object :
C++ signature :
void* createConstraints(GIMLI::ModellingBase {lvalue})

createConstraints( (object)arg1) -> object :

C++ signature :
void* createConstraints(ModellingBase_wrapper {lvalue})
createDefaultStartModel((object)arg1) → object :
C++ signature :
GIMLI::Vector<double> createDefaultStartModel(GIMLI::ModellingBase {lvalue})

createDefaultStartModel( (object)arg1) -> object :

C++ signature :
GIMLI::Vector<double> createDefaultStartModel(ModellingBase_wrapper {lvalue})
createJacobian((object)arg1, (object)model) → object :
C++ signature :
void* createJacobian(GIMLI::ModellingBase {lvalue},GIMLI::Vector<double>)

createJacobian( (object)arg1, (object)model) -> object :

C++ signature :
void* createJacobian(ModellingBase_wrapper {lvalue},GIMLI::Vector<double>)

createJacobian( (object)arg1, (object)model, (object)resp) -> object :

C++ signature :
void* createJacobian(GIMLI::ModellingBase {lvalue},GIMLI::Vector<double>,GIMLI::Vector<double>)

createJacobian( (object)arg1, (object)model, (object)resp) -> object :

C++ signature :
void* createJacobian(ModellingBase_wrapper {lvalue},GIMLI::Vector<double>,GIMLI::Vector<double>)
createJacobian_mt(model, resp)
createMappedModel((object)arg1, (object)model[, (object)background=-1]) → object :

Read only extrapolation of model values given per cell marker to values given per cell. Exterior values will be set to background or prolongated for background = -1.

C++ signature :
GIMLI::Vector<double> createMappedModel(GIMLI::ModellingBase {lvalue},GIMLI::Vector<double> [,double=-1])
createRefinedForwardMesh((object)arg1[, (object)refine=True[, (object)pRefine=False]]) → object :
C++ signature :
void* createRefinedForwardMesh(GIMLI::ModellingBase {lvalue} [,bool=True [,bool=False]])
createStartModel((object)arg1) → object :
C++ signature :
GIMLI::Vector<double> createStartModel(GIMLI::ModellingBase {lvalue})
createStartVector((object)arg1) → object :

DEPRECATED use createStartModel

C++ signature :
GIMLI::Vector<double> createStartVector(GIMLI::ModellingBase {lvalue})
data((object)arg1) → object :

Return the associated data container.

C++ signature :
GIMLI::DataContainer {lvalue} data(GIMLI::ModellingBase {lvalue})
deleteMesh((object)arg1) → object :

Delete the actual mesh.

C++ signature :
void* deleteMesh(GIMLI::ModellingBase {lvalue})
downward(rho, d, z, epr, mur, lam)[source]

Downward continuation of fields.

ep0 = 8.8542e-12
fdefault = array([ 387., 1821., 8388., 41460., 133300.])
initConstraints((object)arg1) → object :
C++ signature :
void* initConstraints(GIMLI::ModellingBase {lvalue})

initConstraints( (object)arg1) -> object :

C++ signature :
void* initConstraints(ModellingBase_wrapper {lvalue})
initJacobian((object)arg1) → object :
C++ signature :
void* initJacobian(GIMLI::ModellingBase {lvalue})

initJacobian( (object)arg1) -> object :

C++ signature :
void* initJacobian(ModellingBase_wrapper {lvalue})
initRegionManager((object)arg1) → object :
C++ signature :
void* initRegionManager(GIMLI::ModellingBase {lvalue})
jacobian((object)arg1) → object :

Return the pointer to the Jacobian matrix associated with this forward operator.

C++ signature :
GIMLI::MatrixBase* jacobian(GIMLI::ModellingBase {lvalue})
jacobian( (object)arg1) -> object :

Return the pointer to the Jacobian matrix associated with this forward operator.

C++ signature :
GIMLI::MatrixBase* jacobian(GIMLI::ModellingBase {lvalue})
jacobianRef((object)arg1) → object :
C++ signature :
GIMLI::Matrix<double> {lvalue} jacobianRef(GIMLI::ModellingBase {lvalue})

jacobianRef( (object)arg1) -> object :

C++ signature :
GIMLI::Matrix<double> {lvalue} jacobianRef(GIMLI::ModellingBase {lvalue})
mapModel((object)arg1, (object)model[, (object)background=0]) → object :
C++ signature :
void* mapModel(GIMLI::ModellingBase {lvalue},GIMLI::Vector<double> [,double=0])
mesh((object)arg1) → object :
C++ signature :
GIMLI::Mesh* mesh(GIMLI::ModellingBase {lvalue})
mu0 = 1.2566370614359173e-06
multiThreadJacobian((object)arg1) → object :

Return number of threads used for Jacobian generation.

C++ signature :
unsigned long multiThreadJacobian(GIMLI::ModellingBase {lvalue})
rdefault = array([7.94, 7.93, 7.93, 7.91, 7.92])
region((object)arg1, (object)marker) → object :

Syntactic sugar for this->regionManager().region(marker).

C++ signature :
GIMLI::Region* region(GIMLI::ModellingBase {lvalue},int)
regionManager((object)arg1) → object :
C++ signature :
GIMLI::RegionManager regionManager(GIMLI::ModellingBase {lvalue})

regionManager( (object)arg1) -> object :

C++ signature :
GIMLI::RegionManager {lvalue} regionManager(GIMLI::ModellingBase {lvalue})
regionManagerRef((object)arg1) → object :
C++ signature :
GIMLI::RegionManager {lvalue} regionManagerRef(GIMLI::ModellingBase {lvalue})
response(par)[source]

Compute response vector by pasting in-phase and out-phase data.

response_mt((object)arg1, (object)model[, (object)i=0]) → object :
C++ signature :
GIMLI::Vector<double> response_mt(GIMLI::ModellingBase {lvalue},GIMLI::Vector<double> [,unsigned long=0])

response_mt( (object)arg1, (object)model [, (object)i=0]) -> object :

C++ signature :
GIMLI::Vector<double> response_mt(ModellingBase_wrapper {lvalue},GIMLI::Vector<double> [,unsigned long=0])
responses(models, respos)
scaling = 1000000.0
setConstraints((object)arg1, (object)C) → object :
C++ signature :
void* setConstraints(GIMLI::ModellingBase {lvalue},GIMLI::MatrixBase*)

setConstraints( (object)arg1, (object)C) -> object :

C++ signature :
void* setConstraints(ModellingBase_wrapper {lvalue},GIMLI::MatrixBase*)
setData((object)arg1, (object)data) → object :

Change the associated data container

C++ signature :
void* setData(GIMLI::ModellingBase {lvalue},GIMLI::DataContainer {lvalue})
setJacobian((object)arg1, (object)J) → object :
C++ signature :
void* setJacobian(GIMLI::ModellingBase {lvalue},GIMLI::MatrixBase*)

setJacobian( (object)arg1, (object)J) -> object :

C++ signature :
void* setJacobian(ModellingBase_wrapper {lvalue},GIMLI::MatrixBase*)
setMesh((object)arg1, (object)mesh [, (object)ignoreRegionManager=False]) -> object : Set new mesh to the forward operator, optionally hold region parameter for the new mesh (i.e. for roll a long)

Set new mesh to the forward operator, optionally hold region parameter for the new mesh (i.e. for roll a long)

C++ signature :
void* setMesh(GIMLI::ModellingBase {lvalue},GIMLI::Mesh [,bool=False])
setMultiThreadJacobian((object)arg1, (object)nThreads) → object :

Set number of threads used for brute force Jacobian generation. 1 is default. If nThreads is greater than 1 you need to implement response_mt with a read only response function. Maybe its worth set the single setThreadCount to 1 than, that you dont find yourself in a threading overkill.

C++ signature :
void* setMultiThreadJacobian(GIMLI::ModellingBase {lvalue},unsigned long)
setRegionManager((object)arg1, (object)reg) → object :
C++ signature :
void* setRegionManager(GIMLI::ModellingBase {lvalue},GIMLI::RegionManager*)
setStartModel((object)arg1, (object)startModel) → object :
C++ signature :
void* setStartModel(GIMLI::ModellingBase {lvalue},GIMLI::Vector<double>)

setStartModel( (object)arg1, (object)startModel) -> object :

C++ signature :
void* setStartModel(ModellingBase_wrapper {lvalue},GIMLI::Vector<double>)
setThreadCount((object)arg1, (object)nThreads) → object :

Set the maximum number of allowed threads for MT calculation. Have to be greater than 0. Will also set ENV(OPENBLAS_NUM_THREADS) .. if used.

C++ signature :
void* setThreadCount(GIMLI::ModellingBase {lvalue},unsigned long)
setVerbose((object)arg1, (object)verbose) → object :

Set verbose state.

C++ signature :
void* setVerbose(GIMLI::ModellingBase {lvalue},bool)
solution((object)arg1) → object :
C++ signature :
GIMLI::Matrix<double> solution(GIMLI::ModellingBase {lvalue})
startModel((object)arg1) → object :
C++ signature :
GIMLI::Vector<double> startModel(GIMLI::ModellingBase {lvalue})

startModel( (object)arg1) -> object :

C++ signature :
GIMLI::Vector<double> startModel(ModellingBase_wrapper {lvalue})
threadCount((object)arg1) → object :

Return the maximum number of allowed threads for MT calculation

C++ signature :
unsigned long threadCount(GIMLI::ModellingBase {lvalue})
verbose((object)arg1) → object :

Get verbose state.

C++ signature :
bool verbose(GIMLI::ModellingBase {lvalue})

verbose( (object)arg1) -> object :

C++ signature :
bool verbose(GIMLI::ModellingBase {lvalue})
vmd_hem(h, rho, d, epr=1.0, mur=1.0, quasistatic=False)[source]

Vertical magnetic dipole (VMD) response.

Parameters:
h : float

flight height

rho : array

resistivity vector

d : array

thickness vector

vmd_total_Ef(h, z, rho, d, epr, mur, tm)[source]

VMD E-phi field (not used actively).

TDEM

class pygimli.physics.em.TDEM(filename=None)[source]

TEM class mainly for holding data etc.

Methods

__call__([i]) Return a single sounding.
getFOP([nr]) Return forward operator.
invert([nr, nlay, thickness]) Do inversion.
load(filename) Road data from usf, txt (siroTEM), tem (TEMfast) or UniK file.
plotRhoa([ax, ploterror, corrramp]) Plot all apparent resistivity curves into one window.
plotTransients([ax]) Plot all transients into one window
stackAll([tmin, tmax]) Stack all measurements yielding a new TDEM class instance.
showInfos  
__init__(filename=None)[source]

Initialize class and (optionally) load data

getFOP(nr=0)[source]

Return forward operator.

invert(nr=0, nlay=4, thickness=None)[source]

Do inversion.

load(filename)[source]

Road data from usf, txt (siroTEM), tem (TEMfast) or UniK file.

plotRhoa(ax=None, ploterror=False, corrramp=False, **kwargs)[source]

Plot all apparent resistivity curves into one window.

plotTransients(ax=None, **kwargs)[source]

Plot all transients into one window

showInfos()[source]
stackAll(tmin=0, tmax=100)[source]

Stack all measurements yielding a new TDEM class instance.



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