Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.yinc,
self.zori,
self.zinc,
self.rotation,
self.yflip,
1,
ilinesp,
xlinesp,
tracidp,
0,
)
if status != 0:
raise RuntimeError("Error when exporting to SEGY (xtgeo engine)")
_cxtgeo.delete_intarray(ilinesp)
_cxtgeo.delete_intarray(xlinesp)
icellname = "ICELL" + grid_id
jcellname = "JCELL" + grid_id
kcellname = "KCELL" + grid_id
self._df[icellname] = indarray
self._df[jcellname] = jndarray
self._df[kcellname] = kndarray
for cellname in [icellname, jcellname, kcellname]:
self._wlogtype[cellname] = "DISC"
self._wlogrecord[icellname] = {ncel: str(ncel) for ncel in range(1, grid.ncol + 1)}
self._wlogrecord[jcellname] = {ncel: str(ncel) for ncel in range(1, grid.nrow + 1)}
self._wlogrecord[kcellname] = {ncel: str(ncel) for ncel in range(1, grid.nlay + 1)}
_cxtgeo.delete_intarray(wivec)
_cxtgeo.delete_intarray(wjvec)
_cxtgeo.delete_intarray(wkvec)
_cxtgeo.delete_doublearray(wxarr)
_cxtgeo.delete_doublearray(wyarr)
_cxtgeo.delete_doublearray(wzarr)
del onelayergrid
jcellname = "JCELL" + grid_id
kcellname = "KCELL" + grid_id
self._df[icellname] = indarray
self._df[jcellname] = jndarray
self._df[kcellname] = kndarray
for cellname in [icellname, jcellname, kcellname]:
self._wlogtype[cellname] = "DISC"
self._wlogrecord[icellname] = {ncel: str(ncel) for ncel in range(1, grid.ncol + 1)}
self._wlogrecord[jcellname] = {ncel: str(ncel) for ncel in range(1, grid.nrow + 1)}
self._wlogrecord[kcellname] = {ncel: str(ncel) for ncel in range(1, grid.nlay + 1)}
_cxtgeo.delete_intarray(wivec)
_cxtgeo.delete_intarray(wjvec)
_cxtgeo.delete_intarray(wkvec)
_cxtgeo.delete_doublearray(wxarr)
_cxtgeo.delete_doublearray(wyarr)
_cxtgeo.delete_doublearray(wzarr)
del onelayergrid
)
# ACTIVE may be missing, meaning all cells are missing!
option = 0
if p_act_v is None:
p_act_v = _cxtgeo.new_intarray(1)
option = 1
_cxtgeo.grd3d_roff2xtgeo_actnum(
self._ncol, self._nrow, self._nlay, p_act_v, self._actnumsv, option
)
_cxtgeo.delete_floatarray(p_cornerlines_v)
_cxtgeo.delete_floatarray(p_zvalues_v)
_cxtgeo.delete_intarray(p_splitenz_v)
_cxtgeo.delete_intarray(p_act_v)
logger.debug("Calling C routines, DONE")
self.zori,
self.zinc,
self.rotation,
self.yflip,
1,
ilinesp,
xlinesp,
tracidp,
0,
)
if status != 0:
raise RuntimeError("Error when exporting to SEGY (xtgeo engine)")
_cxtgeo.delete_intarray(ilinesp)
_cxtgeo.delete_intarray(xlinesp)
nstat = _cxtgeo.grd3d_ecl_tsteps(cfhandle, seq, day, mon, yer, maxdates)
pfile.cfclose()
sq = []
da = []
for i in range(nstat):
sq.append(_cxtgeo.intarray_getitem(seq, i))
dday = _cxtgeo.intarray_getitem(day, i)
dmon = _cxtgeo.intarray_getitem(mon, i)
dyer = _cxtgeo.intarray_getitem(yer, i)
date = "{0:4}{1:02}{2:02}".format(dyer, dmon, dday)
da.append(int(date))
for item in [seq, day, mon, yer]:
_cxtgeo.delete_intarray(item)
zdates = list(zip(sq, da)) # list for PY3
if dataframe:
cols = ["SEQNUM", "DATE"]
df = pd.DataFrame.from_records(zdates, columns=cols)
return df
return zdates
def delete_carray(self, carray):
"""Delete carray SWIG C pointer, return carray as None"""
logger.debug("Enter delete carray values method for %d", id(self))
if carray is None:
return None
if "int" in str(carray):
_cxtgeo.delete_intarray(carray)
carray = None
elif "float" in str(carray):
_cxtgeo.delete_floatarray(carray)
carray = None
elif "double" in str(carray):
_cxtgeo.delete_doublearray(carray)
carray = None
else:
raise RuntimeError("BUG?")
return carray
self._zcornsv,
)
# ACTIVE may be missing, meaning all cells are missing!
option = 0
if p_act_v is None:
p_act_v = _cxtgeo.new_intarray(1)
option = 1
_cxtgeo.grd3d_roff2xtgeo_actnum(
self._ncol, self._nrow, self._nlay, p_act_v, self._actnumsv, option
)
_cxtgeo.delete_floatarray(p_cornerlines_v)
_cxtgeo.delete_floatarray(p_zvalues_v)
_cxtgeo.delete_intarray(p_splitenz_v)
_cxtgeo.delete_intarray(p_act_v)
logger.debug("Calling C routines, DONE")