예제 #1
0
def create_box(
    self,
    dimension=(10, 12, 6),
    origin=(10.0, 20.0, 1000.0),
    oricenter=False,
    increment=(100, 150, 5),
    rotation=30.0,
    flip=1,
):
    """Create a shoebox grid from cubi'sh spec"""

    self._ncol, self._nrow, self._nlay = dimension
    ntot = self.ncol * self.nrow * self.nlay
    ncoord = (self.ncol + 1) * (self.nrow + 1) * 2 * 3
    nzcorn = self.ncol * self.nrow * (self.nlay + 1) * 4

    self._p_actnum_v = _cxtgeo.new_intarray(ntot)
    self._p_coord_v = _cxtgeo.new_doublearray(ncoord)
    self._p_zcorn_v = _cxtgeo.new_doublearray(nzcorn)

    option = 0
    if oricenter:
        option = 1

    _cxtgeo.grd3d_from_cube(
        self.ncol,
        self.nrow,
        self.nlay,
        self._p_coord_v,
        self._p_zcorn_v,
        self._p_actnum_v,
        origin[0],
        origin[1],
        origin[2],
        increment[0],
        increment[1],
        increment[2],
        rotation,
        flip,
        option,
        XTGDEBUG,
    )

    self._actnum_indices = None
    self._filesrc = None
    self._props = None
    self._subgrids = None
    self._roxgrid = None
    self._roxindexer = None
    self._tmp = {}
예제 #2
0
def create_box(
        self,
        dimension=(10, 12, 6),
        origin=(10.0, 20.0, 1000.0),
        oricenter=False,
        increment=(100, 150, 5),
        rotation=30.0,
        flip=1,
):
    """Create a shoebox grid from cubi'sh spec"""

    self._ncol, self._nrow, self._nlay = dimension
    ncoord, nzcorn, ntot = self.vectordimensions

    self._coordsv = np.zeros(ncoord, dtype=np.float64)
    self._zcornsv = np.zeros(nzcorn, dtype=np.float64)
    self._actnumsv = np.zeros(ntot, dtype=np.int32)

    option = 0
    if oricenter:
        option = 1

    _cxtgeo.grd3d_from_cube(
        self.ncol,
        self.nrow,
        self.nlay,
        self._coordsv,
        self._zcornsv,
        self._actnumsv,
        origin[0],
        origin[1],
        origin[2],
        increment[0],
        increment[1],
        increment[2],
        rotation,
        flip,
        option,
    )

    self._actnum_indices = None
    self._filesrc = None
    self._props = None
    self._subgrids = None
    self._roxgrid = None
    self._roxindexer = None
    self._tmp = {}
    self._xtgformat = 1
예제 #3
0
def test_grd3d_from_cube():
    with pytest.raises(
            xtgeo.XTGeoCLibError,
            match="Bug in grd3d_from_cube",
    ):
        _cxtgeo.grd3d_from_cube(
            2,
            2,
            1,
            np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]),
            np.array([1.0, 1.0, 1.0, 1.0]),  # not relevant
            np.array([1, 1, 1, 1], dtype=np.int32),  # not relevant
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            1,
            0,
        )