Exemple #1
0
def my_model_plot(mod, axes=None):

    if axes is None:
        from matplotlib import pyplot as plt
        mpl_init()
        axes = plt.gca()
    else:
        plt = None

    labelspace(axes)
    labels_model(axes=axes)
    sketch_model(mod, axes=axes)
    z = mod.profile('z')
    vp = mod.profile('vp')
    vs = mod.profile('vs')
    axes.plot(vp, z, color=colors[0], lw=2.)
    axes.plot(vs, z, color=colors[2], lw=2.)
    ymin, ymax = axes.get_ylim()
    xmin, xmax = axes.get_xlim()
    xmin = 0.
    my = (ymax-ymin)*0.05
    mx = (xmax-xmin)*0.2
    axes.set_ylim(ymax+my, ymin-my)
    axes.set_xlim(xmin, xmax+mx)
    if plt:
        plt.show()
Exemple #2
0
def my_xp_plot(
        paths, zstart, zstop,
        distances=None,
        as_degrees=False,
        axes=None,
        phase_colors={}):

    if axes is None:
        from matplotlib import pyplot as plt
        mpl_init()
        axes = plt.gca()
    else:
        plt = None

    labelspace(axes)
    xmin, xmax = plot_xp(
        paths, zstart, zstop, axes=axes, phase_colors=phase_colors)

    if distances is not None:
        xmin, xmax = distances.min(), distances.max()

    axes.set_xlim(xmin, xmax)
    labels_xp(as_degrees=as_degrees, axes=axes)

    if plt:
        plt.show()
Exemple #3
0
def my_model_plot(mod, axes=None):

    if axes is None:
        from matplotlib import pyplot as plt
        mpl_init()
        axes = plt.gca()
    else:
        plt = None

    labelspace(axes)
    labels_model(axes=axes)
    sketch_model(mod, axes=axes)
    z = mod.profile('z')
    vp = mod.profile('vp')
    vs = mod.profile('vs')
    axes.plot(vp, z, color=colors[0], lw=2.)
    axes.plot(vs, z, color=colors[2], lw=2.)
    ymin, ymax = axes.get_ylim()
    xmin, xmax = axes.get_xlim()
    xmin = 0.
    my = (ymax-ymin)*0.05
    mx = (xmax-xmin)*0.2
    axes.set_ylim(ymax+my, ymin-my)
    axes.set_xlim(xmin, xmax+mx)
    if plt:
        plt.show()
Exemple #4
0
def my_combi_plot(mod, paths, rays, zstart, zstop, distances=None, as_degrees=False, vred=None, phase_colors={}):
    from matplotlib import pyplot as plt
    mpl_init()
    ax1 = plt.subplot(211)
    labelspace(plt.gca())
    xmin, xmax, ymin, ymax = plot_xt(paths, zstart, zstop, vred=vred, distances=distances, phase_colors=phase_colors)
    if distances is None:
        plt.xlim(xmin, xmax)

    labels_xt(vred=vred, as_degrees=as_degrees)
    plt.setp(ax1.get_xticklabels(), visible=False)
    plt.xlabel('')

    ax2 = plt.subplot(212, sharex=ax1)
    labelspace(plt.gca())
    plot_rays(paths, rays, zstart, zstop, phase_colors=phase_colors)
    xmin, xmax = plt.xlim()
    ymin, ymax = plt.ylim()
    sketch_model(mod)
    
    plot_source(zstart)
    if distances is not None:
        plot_receivers(zstop, distances)
    labels_rays(as_degrees=as_degrees)
    mx = (xmax-xmin)*0.05
    my = (ymax-ymin)*0.05
    ax2.set_xlim(xmin-mx, xmax+mx)
    ax2.set_ylim(ymax+my, ymin-my)
    plt.show()
Exemple #5
0
def my_rays_plot(mod, paths, rays, zstart, zstop, distances=None, as_degrees=False, axes=None, aspect=None, shade_model=True, phase_colors={}):

    if axes is None:
        from matplotlib import pyplot as plt
        mpl_init()
        axes = plt.gca()
    else:
        plt = None

    if paths is None:
        paths = list(set([ x.path for x in rays ]))

    labelspace(axes)
    plot_rays(paths, rays, zstart, zstop, axes=axes, aspect=aspect, phase_colors=phase_colors)
    xmin, xmax = axes.get_xlim()
    ymin, ymax = axes.get_ylim()
    sketch_model(mod, axes=axes, shade=shade_model)

    plot_source(zstart, axes=axes)
    if distances is not None:
        plot_receivers(zstop, distances, axes=axes)
    labels_rays(as_degrees=as_degrees, axes=axes)
    mx = (xmax-xmin)*0.05
    my = (ymax-ymin)*0.05
    axes.set_xlim(xmin-mx, xmax+mx)
    axes.set_ylim(ymax+my, ymin-my)

    if plt:
        plt.show()
Exemple #6
0
def my_xp_plot(paths,
               zstart,
               zstop,
               distances=None,
               as_degrees=False,
               axes=None,
               phase_colors={}):

    if axes is None:
        from matplotlib import pyplot as plt
        mpl_init()
        axes = plt.gca()
    else:
        plt = None

    labelspace(axes)
    xmin, xmax = plot_xp(paths,
                         zstart,
                         zstop,
                         axes=axes,
                         phase_colors=phase_colors)

    if distances is not None:
        xmin, xmax = distances.min(), distances.max()

    axes.set_xlim(xmin, xmax)
    labels_xp(as_degrees=as_degrees, axes=axes)

    if plt:
        plt.show()