Ejemplo n.º 1
0
def image_edi(datadir):
    """ image """

    edi_file = datadir + r"edifiles2\15125A.edi"
    save_file = datadir + 'penetration_depth1d.png'
    edi_path = datadir + 'edifiles'
    savepath = datadir

    pd1d.plot_edi_file(edi_file, savefile=save_file, fig_dpi=400)

    # Choose indices of periods to plot
    period_index_list = [0, 1, 10, 20, 30, 40, 50, 59]
    # Plot profiles for different modes ('det','zxy' or 'zyx')
    pen2d.plot2Dprofile(edi_path,
                        period_index_list,
                        'det',
                        marker='o',
                        tick_params={'rotation': 'vertical'})

    # Create plot for period index number 10 for determinant
    pen3d.plot_latlon_depth_profile(edi_path,
                                    10,
                                    'det',
                                    showfig=True,
                                    savefig=True,
                                    savepath=savepath,
                                    fontsize=11,
                                    fig_dpi=400,
                                    file_format='png')
Ejemplo n.º 2
0
 def test_plot2Dprofile_no_period_index_list(self):
     """
     testing plot2Dprofile without period index list
     exception should be raised
     :return:
     """
     try:
         plot2Dprofile(self._edifiles)
     except Exception:
         pass
Ejemplo n.º 3
0
# selected_periods: the periods in seconds to plot depth for across each
# station.
selected_periods = [10., 100., 500., 600.]
# ptol: tolerance to use when finding nearest period to each selected
# period. If abs(selected period - nearest period) is greater than
# selected period * ptol, then the period is discarded and will appear
# as a gap in the plot.
ptol = 0.20
# zcomponent: component to plot. Valid parameters are 'det, 'zxy' and
# 'zyx'
zcomponent = 'det'  # 'zxy', 'zyx' also options

pen2d.plot2Dprofile(edi_dir=edidir,
                    selected_periods=selected_periods,
                    ptol=ptol,
                    zcomponent=zcomponent,
                    save=True,
                    savepath='/tmp/Depth2D.png')

# selected_period_indices: indices of periods to plot.
# 'ptol' ins't required if using indices.
selected_period_indices = [0, 10, 20]

# p_index: needs to be set to True if using indices.
period_by_index = True

pen2d.plot2Dprofile(edi_dir=edidir,
                    selected_periods=selected_period_indices,
                    period_by_index=period_by_index,
                    zcomponent=zcomponent,
                    save=True,
Ejemplo n.º 4
0
 def test_plot2Dprofile_wrong_rho(self):
     try:
         plot2Dprofile(self._edifiles, self._period_index_list, 'dat')
     except Exception:
         pass
Ejemplo n.º 5
0
 def test_plot2Dprofile_zyx(self):
     plot2Dprofile(self._edifiles, self._period_index_list, 'zyx')
Ejemplo n.º 6
0
 def test_plot2Dprofile_det(self):
     plot2Dprofile(self._edifiles, self._period_index_list, 'det')
Ejemplo n.º 7
0
# change the variable below according to your edi files folder !!!
# edidir = r'C:/mtpywin/mtpy/data/edifiles'  # / is Unix and Win-Dos compatible
# or get this variable from the cmdline:  edidir = sys.argv[1]

edidir = os.path.join(mtpy_path, 'data', 'edifiles2')

# savepath = r'C:\tmp'
temp_dir = tempfile.gettempdir()
print('Using temporary directory ' + temp_dir)
savepath = temp_dir

if not os.path.isdir(edidir):
    print("Error: please provide the path to edi folder")
    sys.exit(1)

period_index_list = [0, 1, 10, 20, 30, 40, 50, 59]  # user to customise

# show three different kind of calculated pen-depth
pen2d.plot2Dprofile(edidir, period_index_list, 'det')

pen2d.plot2Dprofile(edidir, period_index_list, 'zxy')

pen2d.plot2Dprofile(edidir, period_index_list, 'zyx')

plt.savefig(
    os.path.join(
        savepath,
        'penetration_depth_profile.png'),  # change to your preffered filename
    dpi=400)  # change to your preferred file resolution
Ejemplo n.º 8
0
 def test_plot2Dprofile_wrong_rho(self):
     try:
         plot2Dprofile(self._edifiles, self._period_list, zcomponent='dat')
     except Exception:
         pass
Ejemplo n.º 9
0
 def test_plot2Dprofile_zyx_indices(self):
     plot2Dprofile(self._edifiles,
                   self._period_indices,
                   zcomponent='zyx',
                   period_by_index=True)
Ejemplo n.º 10
0
 def test_plot2Dprofile_zyx(self):
     plot2Dprofile(self._edifiles, self._period_list, zcomponent='zyx')
Ejemplo n.º 11
0
 def test_plot2Dprofile_det(self):
     plot2Dprofile(self._edifiles, self._period_list, zcomponent='det')