示例#1
0
def test_simple_plot_with_seismics(tmpdir, show_plot, generate_plot):
    """Test as simple XSECT plot with seismic backdrop."""

    mywell = xtgeo.Well(USEFILE7)
    mycube = xtgeo.Cube(USEFILE6)

    mysurfaces = []
    mysurf = xtgeo.RegularSurface()
    mysurf.from_file(USEFILE2)

    for i in range(10):
        xsurf = mysurf.copy()
        xsurf.values = xsurf.values + i * 20
        xsurf.name = "Surface_{}".format(i)
        mysurfaces.append(xsurf)

    myplot = XSection(
        zmin=1000,
        zmax=1900,
        well=mywell,
        surfaces=mysurfaces,
        cube=mycube,
        sampling=10,
        nextend=2,
    )

    # set the color table, from file
    clist = [0, 1, 222, 3, 5, 7, 3, 12, 11, 10, 9, 8]
    cfil1 = "xtgeo"
    cfil2 = TPATH / "etc/colortables/colfacies.txt"

    assert 222 in clist
    assert "xtgeo" in cfil1
    assert "colfacies" in str(cfil2)

    myplot.set_colortable(cfil1, colorlist=None)

    myplot.canvas(title="Plot with seismics", subtitle="Some well")

    myplot.plot_cube()
    myplot.plot_surfaces(fill=False)

    myplot.plot_well()

    myplot.plot_map()

    if generate_plot:
        myplot.savefig(join(tmpdir, "xsect_wcube.png"), last=False)

    if show_plot:
        myplot.show()
示例#2
0
def test_simple_plot():
    """Test as simple XSECT plot."""

    mywell = xtgeo.Well(USEFILE4)

    mysurfaces = []
    mysurf = xtgeo.RegularSurface()
    mysurf.from_file(USEFILE2)

    for i in range(10):
        xsurf = mysurf.copy()
        xsurf.values = xsurf.values + i * 20
        xsurf.name = "Surface_{}".format(i)
        mysurfaces.append(xsurf)

    myplot = XSection(zmin=1500, zmax=1800, well=mywell, surfaces=mysurfaces)

    # set the color table, from file
    clist = [0, 1, 222, 3, 5, 7, 3, 12, 11, 10, 9, 8]
    cfil1 = "xtgeo"
    cfil2 = "../xtgeo-testdata/etc/colortables/colfacies.txt"

    assert 222 in clist
    assert "xtgeo" in cfil1
    assert "colfacies" in cfil2

    myplot.set_colortable(cfil1, colorlist=None)

    myplot.canvas(title="Manamana", subtitle="My Dear Well")

    myplot.plot_surfaces(fill=False)

    myplot.plot_well(zonelogname="Zonelog")

    # myplot.plot_map()

    myplot.savefig(join(TMPD, "xsect_gbf1.png"))

    if XTGSHOW:
        print("Show plot")
        myplot.show()
示例#3
0
def test_reek1(tmpdir, generate_plot):
    """Test XSect for a Reek well."""

    myfield = xtgeo.Polygons()
    myfield.from_file(USEFILE3, fformat="xyz")

    mywells = []
    wnames = glob.glob(str(USEFILE4))
    wnames.sort()
    for wname in wnames:
        mywell = xtgeo.Well(wname)
        mywells.append(mywell)

    logger.info("Wells are read...")

    mysurfaces = []
    surfnames = glob.glob(str(USEFILE5))
    surfnames.sort()
    for fname in surfnames:
        mysurf = xtgeo.RegularSurface()
        mysurf.from_file(fname)
        mysurfaces.append(mysurf)

    # Troll lobes
    mylobes = []
    surfnames = glob.glob(str(USEFILE5))
    surfnames.sort()
    for fname in surfnames:
        mysurf = xtgeo.RegularSurface()
        mysurf.from_file(fname)
        mylobes.append(mysurf)

    for wo in mywells:
        myplot = XSection(
            zmin=1500,
            zmax=1700,
            well=wo,
            surfaces=mysurfaces,
            zonelogshift=-1,
            outline=myfield,
        )

        myplot.canvas(
            title=wo.truewellname,
            subtitle="Before my corrections",
            infotext="Heisan sveisan",
            figscaling=1.2,
        )

        # myplot.colortable('xtgeo')

        myplot.plot_surfaces(fill=True)

        myplot.plot_surfaces(
            surfaces=mylobes,
            fill=False,
            linewidth=4,
            legendtitle="Lobes",
            fancyline=True,
        )

        myplot.plot_well(zonelogname="Zonelog")

        myplot.plot_wellmap()

        myplot.plot_map()

        if generate_plot:
            myplot.savefig(join(tmpdir, "xsect2a.svg"),
                           fformat="svg",
                           last=False)
            myplot.savefig(join(tmpdir, "xsect2a.png"), fformat="png")