Remove Distrotion from an edi


In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['savefig.dpi'] = 300

In [2]:
import mtpy.core.mt as mt

Input .edi file name


In [3]:
edi_fn = r"c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c.edi"

In [4]:
mt_obj = mt.MT(edi_fn)


 ...nulled all attributes of current MTedi.Edi instance.
reading in Edi file: c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c.edi
C:\Python27\lib\site-packages\mtpy-0.0.1-py2.7.egg\mtpy\analysis\zinvariants.py:214: RuntimeWarning: invalid value encountered in arcsin

Plot MT response


In [5]:
mt_plot = mt_obj.plot_mt_response(plot_pt='y')


 ...nulled all attributes of current MTedi.Edi instance.
reading in Edi file: c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c.edi
C:\Python27\lib\site-packages\mtpy-0.0.1-py2.7.egg\mtpy\imaging\mtplottools.py:485: RuntimeWarning: invalid value encountered in double_scalars

In [6]:
help(mt_obj.remove_distortion)


Help on method remove_distortion in module mtpy.core.mt:

remove_distortion(self) method of mtpy.core.mt.MT instance
    remove distortion following Bibby et al. [2005].
    
    if you want to write a new edi file with distortion removed you can 
    do this by:
    
        >>> import mtpy.core.mt as mt
        >>> mt1 = mt.MT(fn=r"/home/mt/edi_files/mt01.edi")
        >>> D, new_z = mt1.remove_distortion()
        >>> mt1.write_edi_file(new_fn=r"/home/mt/edi_files/mt01_dr.edi",                                   new_Z=new_z)

Remove distortion following Bibby et al. (2005)


In [7]:
distortion, new_z = mt_obj.remove_distortion()
print distortion
mt_obj.write_edi_file(new_fn=r"c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c_dr.edi",
                     new_Z=new_z)


[[ 0.91775899  0.07133161]
 [-0.01108883  1.08875933]]

Plot new MT response


In [8]:
mt_obj_dr = mt.MT(r"c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c_dr.edi")
mt_plot_dr = mt_obj_dr.plot_mt_response(plot_pt='y')


 ...nulled all attributes of current MTedi.Edi instance.
reading in Edi file: c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c_dr.edi
 ...nulled all attributes of current MTedi.Edi instance.
reading in Edi file: c:\Users\jrpeacock\Documents\GitHub\mtpy\examples\data\edi_files\pb40c_dr.edi