WS3DTools: working with WS3DMTINV

Created on Mon Apr 02 11:54:33 2012

@author: a1185872

class MTpy.core.WS3DTools.ListPeriods(fig)[source]
__init__(fig)[source]
__module__ = 'MTpy.core.WS3DTools'
connect()[source]
disconnect()[source]
onclick(event)[source]
MTpy.core.WS3DTools.getPeriods(edipath, errthresh=10)[source]

Plots periods for all stations in edipath and the plot is interactive, just clikc on the period you want to select and it will appear in the console, it will also be saved to lp.plst. To sort this list type lp.plst.sort()

The x’s mark a conformation that the station contains that period. So when looking for the best periods to invert for look for a dense line of x’s

Inputs:
edipath = path to where all your edi files are. Note that only the
impedance components are supported so if you have spectra data, export them from wingling to have impedance information.
errthresh = threshold on the error in impedance estimation, this just
gives an indication on where bad stations and bad periods are, anything above this level will be colored in red.
Outputs:

periodlst = list of periods for each station errorlst = error in the impedance determinant for each station at

each period.
lp = data type lp has attributes:
plst = period list of chosen periods, again to sort this list type
lp.plst.sort(). this will then be the input to make the data file later.
MTpy.core.WS3DTools.getXY(sitesfn, outfn, ncol=5)[source]

get x (e-w) and y (n-s) position of station and put in middle of cell

Input:
sitesfn = full path to sites file output from winglink outfn = full path to .out file output from winglink ncol = number of columns the data is in
Outputs:
xarr = array of relative distance for each station from center of the
grid. Note this is E-W direction
yarr = array of relative distance for each station from center of the
grid. Note this is N-S direction
MTpy.core.WS3DTools.plotDataResPhase(datafn, respfn=None, sitesfn=None, plottype='1', plotnum=1, dpi=150, units='mv', colormode='color')[source]

plot responses from the data file and if there is a response file

Inputs:

datafn = fullpath to data file respfn = full path to respsonse file, if not input, just the data is

plotted. Can be a list of response files from the same inversion
plottype= ‘1’ to plot each station in a different window
[stations] for list of stations to plot (stations are numbers)
plotnum = 1 for just xy,yx
2 for all components
MTpy.core.WS3DTools.plotTensorMaps(datafn, respfn=None, sitesfn=None, periodlst=None, esize=(1, 1, 5, 5), ecolor='phimin', colormm=[(0, 90), (0, 1), (0, 4), (-2, 2)], xpad=0.5, units='mv', dpi=150)[source]

plot phase tensor maps for data and or response, each figure is of a different period. If response is input a third column is added which is the residual phase tensor showing where the model is not fitting the data well. The data is plotted in km in units of ohm-m.

Inputs:

datafn = full path to data file respfn = full path to response file, if none just plots data sitesfn = full path to sites file periodlst = indicies of periods you want to plot esize = size of ellipses as:

0 = phase tensor ellipse 1 = phase tensor residual 2 = resistivity tensor ellipse 3 = resistivity tensor residual

ecolor = ‘phimin’ for coloring with phimin or ‘beta’ for beta coloring colormm = list of min and max coloring for plot, list as follows:

0 = phase tensor min and max for ecolor in degrees 1 = phase tensor residual min and max [0,1] 2 = resistivity tensor coloring as resistivity on log scale 3 = resistivity tensor residual coloring as resistivity on

linear scale

xpad = padding of map from stations at extremities (km) units = ‘mv’ to convert to Ohm-m dpi = dots per inch of figure

MTpy.core.WS3DTools.readDataFile(datafn, sitesfn=None, units='mv')[source]

read in data file

Inputs:
datafn = full path to data file sitesfn = full path to sites file output by winglink units = ‘mv’ always
Outputs:

period = list of periods used for the inversion zarr = array of impedance values

(number of staitons x number of periods x 2 x 2)

zerr = array of errors in impedance component nsarr = station locations relative distance from center of grid in N-S ewarr = station locations relative distance from center of grid in E-W sitelst = list of sites used in data

MTpy.core.WS3DTools.readModelFile(mfile, ncol=7)[source]

read in a model file

MTpy.core.WS3DTools.readSitesFile(sitesfn)[source]

read sites_ file output from winglink

Input:
sitesfn = full path to the sites file output by winglink
Output:
slst = list of dictionaries for each station. Keys include:
station = station name dx = number of blocks from center of grid in East-West direction dy = number of blocks from center of grid in North-South direction dz = number of blocks from center of grid vertically number = block number in the grid

sitelst = list of station names

MTpy.core.WS3DTools.readWLOutFile(outfn, ncol=5)[source]

read .out file from winglink

Inputs:
outfn = full path to .out file from winglink
Outputs:
dx,dy,dz = cell nodes in x,y,z directions (note x is to the East here
and y is to the north.)
MTpy.core.WS3DTools.writeInit3DFile(outfn, rhostart=100, ncol=5, savepath=None)[source]

Makes an init3d file for WSINV3D

Inputs:
outfn = full path to .out file from winglink rhostart = starting homogeneous half space in Ohm-m ncol = number of columns for data to be written in savepath = full path to save the init file
Output:
ifile = full path to init file
MTpy.core.WS3DTools.writeStartupFile(datafn, initialfn=None, outputfn=None, savepath=None, apriorfn=None, modells=[5, 0.3, 0.3, 0.3], targetrms=1.0, control=None, maxiter=10, errortol=None, staticfn=None, lagrange=None)[source]

makes a startup file for WSINV3D t. Most of these parameters are not input

Inputs:
datafn = full path to the data file written for inversion initialfn = full path to init file outputfn = output stem to which the _model and _resp will be written savepath = full path to save the startup file to apriorfn = full path to apriori model modells = smoothing parameters targetrms = target rms control = something maxiter = maximum number of iterations errotol = error tolerance for the computer? staticfn = full path to static shift file name lagrange = starting lagrange multiplier
Outputs:
sfile = full path to startup file
MTpy.core.WS3DTools.writeWSDataFile(sitesfn, outfn, periodlst, edipath, zerr=0.05, ptol=0.15, zerrmap=[10, 1, 1, 10], savepath=None, ncol=5, units='mv')[source]

writes a data file for WSINV3D from winglink outputs

Inputs:

sitesfn = sites filename (full path) outfn = winglink .out file periodlst = periods to extract from edifiles can get them from

using the function getPeriods.

edipath = path to edifiles savepath = directory or full path to save data file to, default path

is dirname sitesfn. saves as: savepath/WSDataFile.dat

zerr = percent error to give to impedance tensor components ptol = percent tolerance to locate frequencies in case edi files don’t

have the same frequencies. Need to add interpolation
zerrmap = multiple to multiply err of zxx,zxy,zyx,zyy by.
Note the total error is zerr*zerrmap[ii]

ncol = number of columns in outfn

Outputs:
datafn = full path to data file, saved in dirname(sitesfn) or savepath
where savepath can be a directory or full filename

Previous topic

OCCAMTools: an interface to Scripp’s Occam inversion program

Next topic

WinglinkTools: work with WinGLink MT inversion software

This Page