Z: calculate properties of impedance tensors

Created on Mon May 03 13:44:51 2010

@author: a1185872

class MTpy.core.Z.Edi(edifilename, ncol=5)[source]

Bases: object

This is a data type for edi files. Included are self.edifn=edifilename

Edi.header = header information about the survey area (dictionary) Edi.info = information about data processing (dictionary) Edi.measurement = information about measurement setup (dictionary) Edi.lat = latitude in decimal degrees Edi.lon = longitude in decimal degrees Edi.elevation = elevation in meters Edi.frequency = array of frequencies for estimated transfer functions Edi.z = array (nf,2,2) of impedance components (nf=# of frequencies) Edi.zvar = array (nf,2,2) of variance estimation of Z Edi.zrot = array (nf) of rotation angles used Edi.tipper = array (nf,2) of tipper components Edi.tippervar = array (nf,2) of variance estimation of tipper Edi.trot = array (nf) of rotation angles used
__dict__ = <dictproxy object at 0x0A13A9B0>
__init__(edifilename, ncol=5)[source]
__module__ = 'MTpy.core.Z'
__weakref__

list of weak references to the object (if defined)

getInfo()[source]
rewriteedi(znew=None, zvarnew=None, freqnew=None, newfile='y', tipnew=None, tipvarnew=None, thetar=0, ext='dr')[source]

rewriteedi(edifile) will rewrite an edifile say if it needs to be rotated or distortion removed.

Inputs:

edifile = full path to edifile to be rewritten znew = impedance tensor if a new one has been created zvarnew = errors in impedance tensor if a new one has been created freqnew = new frequency list if one has been created newfile = ‘y’ for yes or ‘n’ for no if you want a new file to be

created.

tipnew = new tipper array tipvarnew = new tipper error array thetar = rotation angle counter clockwise (N=0, E=-90) ext = extension on the end of the file name before .edi

Outputs:
nedi = dirpath(edifile)+basename(edifile)+rw or dr if dr=’y’
class MTpy.core.Z.PhaseTensor(z, zvar=None, rotate=180, rotz=0)[source]

PhaseTensor calculates the components of the phase tensor following Caldwell et al. [2004].

__init__(z, zvar=None, rotate=180, rotz=0)[source]
__module__ = 'MTpy.core.Z'
class MTpy.core.Z.PhaseTensorResidual(z1, z2, rotz=0, rotate=180)[source]

calculates the tensor residual

__init__(z1, z2, rotz=0, rotate=180)[source]
__module__ = 'MTpy.core.Z'
class MTpy.core.Z.ResPhase(z, period, zvar=None, rotz=0, ffactor=1)[source]

ResPhase is a resistivity and phase class

__init__(z, period, zvar=None, rotz=0, ffactor=1)[source]
__module__ = 'MTpy.core.Z'
class MTpy.core.Z.ResistivityTensor(z, frequency, rotate=180, rotz=0)[source]

gets components of the resistivity tensor defined by Weckmann et al. [2003]

__init__(z, frequency, rotate=180, rotz=0)[source]
__module__ = 'MTpy.core.Z'
class MTpy.core.Z.ResistivityTensorResidual(z1, z2, frequency, rotz=0, rotatecoord=180)[source]

will calculate the resistivity residual between two tensors

__init__(z1, z2, frequency, rotz=0, rotatecoord=180)[source]
__module__ = 'MTpy.core.Z'
class MTpy.core.Z.Tipper(tipper, rott=0)[source]

Tipper is a type with attributes:

__init__(tipper, rott=0)[source]
__module__ = 'MTpy.core.Z'
class MTpy.core.Z.Z(edifn, ncol=5)[source]

Bases: MTpy.core.Z.Edi

Z is a data type to deal with edifiles and manipulate them to do informative characterization.

The methods are:

__init__(edifn, ncol=5)[source]
__module__ = 'MTpy.core.Z'
getInvariants(thetar=0)[source]

Calculate the invariants according to Weaver et al. (2003) output is: a class with attributes: inv1, inv2, inv3, inv4, inv5, inv6, inv7, q, strike, strikeerr

getPhaseTensor(rotate=180, thetar=0)[source]

Calculate phase tensor elements following Caldwell et al. 2004. Inputs:

rotate = coordinate axis is assumed to be Y north and X east, if the
data is in X north and Y east than a rotation of 180 is necessary
thetar = will rotate the data assuming that Y is 0 and X is 90 so
clockwise is positive.
Returns a phase tensor class with attributes of:

phi = phase tensor phivar = phase tensor errors phimin = minimum of the phase tensor in radians (invariant) phiminvar = errors of phimin phimax = maximum of phase tensor in radians (invariant) phimaxvar = erros of phimax alpha = angle between reference axis and coordinate axis alphavar = errors of alpha beta = anble between reference axis and principal axis of ellipse betavar = erros in beta azimuth = difference between alpha and beta orienting ellipse in

degrees, is measured counter-clockwise with x=0, y=90

azimuthvar = erros in azimuth phiminang = phimin in degrees phiminangvar = errors in phimin in degrees ellipticity = measure of 3D effects ellipticityvar = errors in ellipticity phidet = determinant of phi as phimin*phimax from Bibby et al.[2005] phidetvar = errors in phidet

getResPhase(ffactor=1, thetar=0)[source]

getResPhase will return a ResPhase class that has attributes of all 4 components of resistivity and phase as well as the errors and determinants.

Inputs:
ffactor = a fudge factor if the calibration or gains aren’t quite
correct
thetar = will rotate the data assumint that Y is 0 and X is 90 so
clockwise is positive.

Returns a type with attributes of all components of the resistivity and phase

getResTensor(thetar=0, rotate=180)[source]

getResTensor will return a data type that describes the reistivity tensor defined by Weckmann et al. [2003]

Input:

thetar = rotation of impedance tensor rotate = rotation of coordinate system, default is Y to north and

X to the east
getTipper(thetar=0)[source]

Get tipper information and return a type with attributes: magreal magimag anglereal angleimag

need to add error bars

plotPTAll(xspacing=6, esize=5, fignum=1, thetar=0, save='n', savepath=None, fmt='pdf', coordrot=180, ptmm=None, rpmm=None, dpi=300)[source]

plotAll will plot phase tensor, strike angle, min and max phase angle, azimuth, skew, and ellipticity as subplots on one plot. It also plots the resistivity tensor along side the phase tensor for comparison.

Inputs:

xspacing = spacing of tensors along x direction esize = size of tensor ellipses fignum = number of figure thetar = will rotate the data assuming that Y is 0 and X is 90 so

clockwise is positive.

save = save the figure ‘y’ or ‘n’ savepath = path to save to, saves as savepathstatioAll.fmt fmt = format of save figure pdf,svg,eps,ps,png coordrot = rotation of coordinate directions by multiples of 90 rpmm = min and max of resistivity tensor on log10 scale ptmm = min an max of phase tensor

plotResPhase(thetar=0, fignum=1, plottype=1, title=None, ffactor=1, savefigfilename=None, dpi=None, fmt=None, orientation=None, phaselimits=(0, 90))[source]

plotResPhase(filename,fignum) will plot the apparent resistivity and phase for TE and TM modes or all modes. If there is tipper data it will be plotted at the bottom as real and imaginary parts.

Inputs:
filename = filename containing impedance (.edi) or resistivity and phase
information (.dat)

fignum = figure number ffactor = fudge factor for computing resistivity from impedances thetar = rotation angle of impedance tensor (deg or radians) plottype = 1 for just Ex/By and Ey/Bx

2 for all 4 components 3 for off diagonal plus the determinant

title = title of plot savefigfilename = supply filename to save figure to if desired dpi = figure resolution format = file type of saved figure pdf,svg,eps... orientation = orientation of figure on A4 paper

Outputs:
none
plotTipper(thetar=0, fignum=1, plotnum=1, dpi=100)[source]

plotTipper will plot the resistivity, phase and tipper

removeDistortion(thetar=0)[source]

removeDistortion(self) will remove the distortion from the impedance tensor as prescribed by Bibby et al. [2005].

Inputs:
thetar = will rotate the data assuming that Y is 0 and X is 90 so
clockwise is positive.
Outputs:
D = distortion tensor newedifn = full path to new edifile the edifile as station+dr.edi.
removeStaticShift(stol=0.2, dm=1000, fspot=20)[source]

removeStaticShift(edifile,stol=.2,dm=1000) will remove static shift by calculating the median of respones of near by stations, within dm. If the ratio of the station response to the median on either side of 1+-stol then the impedance tensor for that electric component will be corrected for static shift.

Inputs:
edifile = full path to edi file. Note nearby stations will be
looked for in the dirname of edifile. So have all edis in one folder
stol = ratio tolerance. If there is no static shift the ratio
between the response and the median response should be 1, but noise and other factors can be present so a tolerance around 1 is assumed.
dm = nearby station radius in meters. If there is no station
within that radius then no static shift will be corrected for.
fspot = the last index of frequencies to look at. So if you want
to look for static shift in the first 20 frequencies fspot=20
Outputs:
newedifile = full path to new edifile
class MTpy.core.Z.Zinvariants(z, rotz=0)[source]

calculates invariants from Weaver [2003]

__init__(z, rotz=0)[source]
__module__ = 'MTpy.core.Z'

Previous topic

MTtools: tools for working with MT response functions

Next topic

OCCAMTools: an interface to Scripp’s Occam inversion program

This Page