コード例 #1
0
def test_reduce_to_one_layer():
    """Reduce grid to one layer"""

    logger.info("Read grid...")

    grd1 = Grid(EMEGFILE2)
    grd1.reduce_to_one_layer()

    assert grd1.nlay == 1
コード例 #2
0
def test_report_zlog_mismatch():
    """Report zone log mismatch grid and well."""
    logger.info("Name is {}".format(__name__))
    g1 = Grid()
    g1.from_file(GRIDFILE)

    g2 = Grid()
    g2.from_file(GRIDFILE)

    g2.reduce_to_one_layer()
    g2.to_file(os.path.join(TDMP, "test.roff"), fformat="roff")

    z = GridProperty()
    z.from_file(ZONEFILE, name="Zone")

    w1 = Well(WELL1)
    w2 = Well(WELL2)
    w3 = Well(WELL3)
    w4 = Well(WELL4)
    w5 = Well(WELL5)
    w6 = Well(WELL6)
    w7 = Well(WELL7)

    wells = [w1, w2, w3, w4, w5, w6, w7]

    resultd = {}
    # matchd = {'WI_1': 69, 'WI_3': 70, 'OP_4': 74, 'OP_5': 75, 'OP_1': 75,
    #           'OP_2': 74, 'OP_3': 70}

    for w in wells:
        response = g1.report_zone_mismatch(
            well=w,
            zonelogname="Zonelog",
            zoneprop=z,
            onelayergrid=g2,
            zonelogrange=(1, 3),
            option=0,
            depthrange=[1300, 9999],
        )

        if response is None:
            continue
        else:
            logger.info(response)
            match = int(float("{0:.4f}".format(response[0])))
            logger.info(match)
            resultd[w.wellname] = match
コード例 #3
0
def test_report_zlog_mismatch():
    """Report zone log mismatch grid and well."""
    logger.info('Name is {}'.format(__name__))
    g1 = Grid()
    g1.from_file(gridfile)

    g2 = Grid()
    g2.from_file(gridfile)

    g2.reduce_to_one_layer()
    g2.to_file('/tmp/test.roff', fformat='roff')

    z = GridProperty()
    z.from_file(zonefile, name='Zone')

    w1 = Well(well1)
    w2 = Well(well2)
    w3 = Well(well3)
    w4 = Well(well4)
    w5 = Well(well5)
    w6 = Well(well6)
    w7 = Well(well7)

    wells = [w1, w2, w3, w4, w5, w6, w7]

    resultd = {}
    # matchd = {'WI_1': 69, 'WI_3': 70, 'OP_4': 74, 'OP_5': 75, 'OP_1': 75,
    #           'OP_2': 74, 'OP_3': 70}

    for w in wells:
        response = g1.report_zone_mismatch(well=w,
                                           zonelogname='Zonelog',
                                           zoneprop=z,
                                           onelayergrid=g2,
                                           zonelogrange=(1, 3),
                                           option=0,
                                           depthrange=[1300, 9999])

        if response is None:
            continue
        else:
            logger.info(response)
            match = int(float("{0:.4f}".format(response[0])))
            logger.info(match)
            resultd[w.wellname] = match
コード例 #4
0
def test_reduce_to_one_layer():
    """Crop a grid."""

    logger.info("Read grid...")

    grd1 = Grid(EMEGFILE2)
    geom1v1 = grd1.get_geometrics(allcells=True, cellcenter=True)
    geom1v2 = grd1.get_geometrics(allcells=True, cellcenter=True, _ver=2)

    grd2 = Grid(EMEGFILE2)
    grd2.reduce_to_one_layer()
    geom2v1 = grd2.get_geometrics(allcells=True, cellcenter=True)
    geom2v2 = grd2.get_geometrics(allcells=True, cellcenter=True, _ver=2)

    print("XXXX1V1", geom1v1)
    print("XXXX1V2", geom1v2)

    print("XXXX2V1", geom2v1)
    print("XXXX2V2", geom2v2)