Skip to main content

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)

Metadata

Release files for pygridsio3d 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygridsio3d 0.1.0
File Size Uploaded
pygridsio3d-0.1.0.tar.gz 21.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygridsio3d 0.1.0
File Interpreter ABI Platform
pygridsio3d-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / pygridsio3d-0.1.0.tar.gz

Download URL pygridsio3d-0.1.0.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
180e653e0d103869de08a25f3a0c514db2c22cae076350c9cf5d9484a5dfff34
BLAKE2b-256 checksum
How to use checksums
8ef226aa829a229c12eadfca78694534c788b4fa2407b8d0ad27ded3af426c2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / pygridsio3d-0.1.0-py3-none-any.whl

Download URL pygridsio3d-0.1.0-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f47e031289ac532447324f655652c510477170215639072b627ded9a5a31b696
BLAKE2b-256 checksum
How to use checksums
8134a6769e540dd064f73dbac568c785111de1e110794cb25bf18bae9e655ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page