Created on Mon May 03 13:44:51 2010
@author: a1185872
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
list of weak references to the object (if defined)
rewriteedi(edifile) will rewrite an edifile say if it needs to be rotated or distortion removed.
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
PhaseTensor calculates the components of the phase tensor following Caldwell et al. [2004].
calculates the tensor residual
ResPhase is a resistivity and phase class
gets components of the resistivity tensor defined by Weckmann et al. [2003]
will calculate the resistivity residual between two tensors
Tipper is a type with attributes:
Bases: MTpy.core.Z.Edi
Z is a data type to deal with edifiles and manipulate them to do informative characterization.
The methods are:
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
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.
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 will return a ResPhase class that has attributes of all 4 components of resistivity and phase as well as the errors and determinants.
Returns a type with attributes of all components of the resistivity and phase
getResTensor will return a data type that describes the reistivity tensor defined by Weckmann et al. [2003]
thetar = rotation of impedance tensor rotate = rotation of coordinate system, default is Y to north and
X to the east
Get tipper information and return a type with attributes: magreal magimag anglereal angleimag
need to add error bars
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.
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(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.
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
plotTipper will plot the resistivity, phase and tipper
removeDistortion(self) will remove the distortion from the impedance tensor as prescribed by Bibby et al. [2005].
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.