pygimli.physics.sNMR#
Surface nuclear magnetic resonance (NMR) data inversion
Overview#
Classes
|
Magnetic resonance sounding (MRS) manager class. |
|
MRS1dBlockQTModelling - pygimli modelling class for block-mono QT inversion |
|
manager class for several MRS data along a profile for joint inversion |
Classes#
- class pygimli.physics.sNMR.MRS(name=None, verbose=True, **kwargs)[source]#
Bases:
object
Magnetic resonance sounding (MRS) manager class.
- Variables:
q (t,) –
error (data,) –
z (K,) –
modelU (model, modelL,) –
- loadMRSI - load MRSI (MRSmatlab format) data
- showCube - show any data/error/misfit as data cube (over q and t)
- showDataAndError - show data and error cubes
- showKernel - show Kernel matrix
- createFOP - create forward operator
- createInv - create pygimli Inversion instance
- run - run block-mono (alternatively smooth-mono) inversion (with bootstrap)
- calcMCM - compute model covariance matrix and thus uncertainties
- splitModel - return thickness, water content and T2* time from vector
- showResult/showResultAndFit - show inversion result (with fit)
- runEA - run evolutionary algorithm (GA, PSO etc.) using inspyred
- plotPopulation - plot final population of an EA run
- __init__(name=None, verbose=True, **kwargs)[source]#
MRS init with optional data load from mrsi file
- Parameters:
name (string) – Filename with load data and kernel (.mrsi) or just data (.mrsd)
verbose (bool) – be verbose
:param kwargs - see
MRS.loadMRSI()
.:
- createInv(nlay=3, lam=100.0, verbose=True, **kwargs)[source]#
Create inversion instance (and fop if necessary with nlay).
- invert(nlay=3, lam=100.0, startvec=None, verbose=True, uncertainty=False, **kwargs)[source]#
Easiest variant doing all (create fop and inv) in one call.
- loadDataNPZ(filename, **kwargs)[source]#
Load data and kernel from numpy gzip packed file.
The npz file contains the fields: q, t, D, (E), z, K
- loadErrorCube(filename='errorcube.dat')[source]#
Load error cube from a single ascii file (old stuff).
- loadKernelNPZ(filename, **kwargs)[source]#
Load data and kernel from numpy gzip packed file.
The npz file contains the fields: q, t, D, (E), z, K
- loadMRSD(filename, usereal=False, mint=0.0, maxt=2.0)[source]#
Load mrsd (MRS data) file: not really used as in MRSD.
- plotPopulation(maxfitness=None, fitratio=1.05, savefile=True)[source]#
Plot fittest individuals (fitness<maxfitness) as 1d models
- run(verbose=True, uncertainty=False, **kwargs)[source]#
Easiest variant doing all (create fop and inv) in one call.
- runEA(nlay=None, eatype='GA', pop_size=100, num_gen=100, runs=1, mp_num_cpus=8, **kwargs)[source]#
Run evolutionary algorithm using the inspyred library
- Parameters:
nlay (int [taken from classic fop if not given]) – number of layers
pop_size (int [100]) – population size
num_gen (int [100]) – number of generations
runs (int [pop_size*num_gen]) – number of independent runs (with random population)
eatype (string ['GA']) –
- algorithm, choose among:
’GA’ - Genetic Algorithm [default] ‘SA’ - Simulated Annealing ‘DEA’ - Discrete Evolutionary Algorithm ‘PSO’ - Particle Swarm Optimization ‘ACS’ - Ant Colony Strategy ‘ES’ - Evolutionary Strategy
- showCube(ax=None, vec=None, islog=None, clim=None, clab=None)[source]#
Plot any data (or response, error, misfit) cube nicely.
- showResult(figsize=(10, 8), save='', fig=None, ax=None)[source]#
Show theta(z) and T2*(z) (+uncertainties if there).
- class pygimli.physics.sNMR.MRS1dBlockQTModelling(nlay, K, zvec, t, verbose=False)[source]#
Bases:
ModellingBaseMT__
MRS1dBlockQTModelling - pygimli modelling class for block-mono QT inversion
f=MRS1dBlockQTModelling(lay, KR, KI, zvec, t, verbose = False )
- class pygimli.physics.sNMR.MRSprofile(filename=None, x=None, dx=1, x0=0, **kwargs)[source]#
Bases:
object
manager class for several MRS data along a profile for joint inversion
- load - load mrs files from a directory
- set X - set x vector
- showData - show MRS data
- independentBlock1dInversion - perform independent 1D block inversion
- block1dInversion - 1D block inversion of all data sets together
- blockLCInversion - 1D block laterally constrained inversion of all data
- printFits - print total misfit (chi^2, rms) and individual values
- showModel - show LCI model
- __init__(filename=None, x=None, dx=1, x0=0, **kwargs)[source]#
Initialize profile object by mrs objects and optional positions.
- block1dInversion(nlay=2, lam=100.0, show=False, verbose=True, uncertainty=False)[source]#
Invert all data together by a 1D model (more general solution).
- block1dInversionOld(nlay=2, startModel=None, verbose=True, uncertainty=False, **kwargs)[source]#
Invert all data together by one 1D model (variant 1 - all equal).
- blockLCInversion(nlay=2, startModel=None, **kwargs)[source]#
Laterally constrained (piece-wise 1D) block inversion.
- independentBlock1dInversion(nlay=2, lam=100, startModel=None)[source]#
Independent inversion of all soundings.
- load(filenames, **kwargs)[source]#
load mrs files in a list of (single) MRS handlers filename can be a list of mrsi files or a directory to search Additional parameters: usereal, mint, maxt (see MRS.load)
- showModel(showFit=0, cmap='Spectral', figsize=(13, 12), wlim=(0, 0.5), tlim=(0.05, 0.5))[source]#
Show 2d model as stitched 1d models along with fit.