In [10]:
import addcoord
import pygslib
In [11]:
parameters = {
'datafl': 'true.dat', # path to the input grid file or data
'outfl' : None, # path to the output grid file
'ireal' : 1, # realization number
'nx' : 50, # number of rows, cols and levels
'ny' : 50,
'nz' : 1,
'xmn' : 0.5, # coordinates of the centroid of first/corner block
'ymn' : 0.5,
'zmn' : 0,
'xsiz' : 1, # grid node separation
'ysiz' : 1,
'zsiz' : 1}
In [12]:
result =addcoord.addcoord(parameters)
In [13]:
result.head()
Out[13]:
In [14]:
# genarate a block model
nx = 50
ny = 70
nz = 10
dx = 20
dy = 20
dz = 10
xorg = 0
yorg = 0
zorg = 0
# create a block model object
bmod = pygslib.blockmodel.Blockmodel(nx=nx,ny=ny,nz=nz,
dx=dx,dy=dy,dz=dz,
xorg=xorg,yorg=yorg,zorg=zorg)
# create a full model
bmod.create_IJK()
In [15]:
result =addcoord.addcoord(bmod)
In [16]:
result.head()
Out[16]:
In [17]:
bmod.set_blocks(bmod.bmtable.merge(result, on='IJK' ))
bmod.bmtable.head()
Out[17]:
In [18]:
bmod.calc_ixyz_fromijk()
bmod.calc_xyz_fromixyz()
bmod.bmtable.head()
Out[18]:
In [ ]: