can make I,J,K slice plots of grdecl files and create samples of the grid for use in pygridsio
Project description
pygridsio3d
Introduction
This is a lightweight library to read VOXET and GRDECL ASCII files and to plot the grid in 2D sections and map view. It can only read simple GRDECL files that use COORD and ZCORN. It is primarily intended for quick visualization and exploration of simple GRDECL files, and is not a full-featured GRDECL parser or grid engine.
Installation
pygridsio3d is available via the pypi package registry:
pip install pygridsio3d
Usage
examples code to read a grdecl file and plot i,j,k sections:
from pygridsio3d import read_grid3d
from pygridsio3d import plot_vertical_jslice, plot_vertical_islice, plot_horizontal_kslice
from pathlib import Path
read_keys = ['PERMX', 'PORO', 'FACIES']
demo_path = Path(__file__).resolve().parent / 'demo_data' / 'your_grdecl_file.grdecl'
g = read_grid3d(demo_path, read_keys=read_keys)
i_index = 16
j_index = 16
k_index = 100
output_data_path = Path(__file__).resolve().parent / 'output_data'
output_data_path.mkdir(parents=True, exist_ok=True)
proplabel = 'PERMX'
out_jslice = output_data_path / f'{proplabel}_jslice{j_index}.png'
out_islice = output_data_path / f'{proplabel}_islice{i_index}.png'
out_kslice = output_data_path / f'{proplabel}_kslice{k_index}.png'
plot_vertical_jslice(g,j_index=j_index, proplabel=proplabel, out=out_jslice,
title=f'J-slice {j_index} colored by {proplabel}')
plot_vertical_islice(g, i_index=i_index, proplabel=proplabel, out=out_islice,
title=f'I-slice {i_index} colored by {proplabel}')
plot_horizontal_kslice(g, k_index=k_index, proplabel=proplabel, out=out_kslice,
title=f'K-slice {k_index} colored by {proplabel}')
In extension to evaluate a summation of thickness weighted permeability in the vertical direction:
from pygridsio3d import Grid3dFunc
from pygridsio import plot_grid
gr_func = Grid3dFunc(g)
# create a basemask which ignores the first layer of the grid
basemask = gr_func.init_basemask(klow=1)
# modify the Grdecl actnum for plotting sections as well
g.set_mask(basemask)
masklabel = 'FACIES'
mask = gr_func.get_custom_mask(property_key=masklabel, property_value=2)
grid_thick = gr_func.get_sumthick(mask)
grid_d = gr_func.get_average_depth(mask)
plot_grid(grid_thick)
plot_grid(grid_d)
proplabel = 'PERMX'
grid_kh = gr_func.get_sumthick_prop(mask, property_key=proplabel)
grid_kh_d = gr_func.get_average_depth_prop(mask, property_key=proplabel)
plot_grid(grid_kh)
plot_grid(grid_kh_d)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygridsio3d-0.1.0.tar.gz.
File metadata
- Download URL: pygridsio3d-0.1.0.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
180e653e0d103869de08a25f3a0c514db2c22cae076350c9cf5d9484a5dfff34
|
|
| MD5 |
7ef66d9876c271c6a13f2637f1e0b35b
|
|
| BLAKE2b-256 |
8ef226aa829a229c12eadfca78694534c788b4fa2407b8d0ad27ded3af426c2e
|
File details
Details for the file pygridsio3d-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pygridsio3d-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f47e031289ac532447324f655652c510477170215639072b627ded9a5a31b696
|
|
| MD5 |
cced882021f919da8ab1a33ae57dcd13
|
|
| BLAKE2b-256 |
8134a6769e540dd064f73dbac568c785111de1e110794cb25bf18bae9e655ef1
|