Skip to main content

XTGeo is a Python library for 3D grids, surfaces, wells, etc

Project description

XTGeo builds linting Codacy Badge codecov Code style: black PyPI version Documentation Status PyPI - Python Version PyPI - License

Introduction

XTGeo is a LGPL licensed Python library with C backend to support manipulation of (oil industry) subsurface reservoir modelling. Typical users are geoscientist and reservoir engineers working with reservoir modelling, in relation with RMS. XTGeo is developed in Equinor.

Detailed documentation for XTGeo at Read the Docs

Feature summary

  • Python 2.7+ and 3.5+ support
  • Focus on high speed, using numpy and pandas with C backend
  • Regular surfaces, i.e. 2D maps with regular sampling and rotation
  • 3D grids (corner-point), supporting several formats such as RMS and Eclipse
  • Support of seismic cubes, using segyio as backend for SEGY format
  • Support of well data, line and polygons (still somewhat immature)
  • Operations between the data types listed above; e.g. slice a surface with a seismic cube
  • Optional integration with ROXAR API python for several data types (see note later)
  • Linux is main development platform, but Windows and MacOS (64 bit) are supported and PYPI wheels are provided.

Installation

For Linux, Windows and MacOS 64bit, PYPI installation is enabled:

pip install xtgeo

For detailed installation instructions (implies C compiling), see the documentation.

Getting started

from xtgeo.surface import RegularSurface

# create an instance of a surface, read from file
mysurf = RegularSurface("myfile.gri")  # Irap binary as default

print("Mean is {}".format(mysurf.values.mean()))

# change date so all values less than 2000 becomes 2000
# The values attribute gives the Numpy array

mysurface.values[mysurface.values < 2000] = 2000

# export the modified surface:
mysurface.to_file("newfile.gri")

Note on RMS Roxar API integration

The following applies to the part of the XTGeo API that is connected to Roxar API (RMS):

RMS is neither an open source software nor a free software and any use of it needs a software license agreement in place.

History

Version 2

2.8.3

  • Fix a bug for renaming points and polygons coordinate columns, ref #349
  • Added and "F" in SPECGRID when exporting 3D grid to GRDECL format

2.8.2

  • Fix a bug wrt writing bytestream instances on non-Linux, #342

2.8.1

  • Fix a clib related issue that made XTGeo import feil on RHEL6 in Python2, #346

2.8.0

  • New features:
    • Added gridlink option in GridProperty import, #329
    • More keyword options in Grid get_ijk_from_points() #327
    • Well method report_zone_mismatch() rewritten and improved
    • Well: added get_surface_picks()
    • Initialise a new GridProperty instance from existing GridProperty
    • Grid(): added name as attribute #319
  • Bug fixes:
    • The gridproperty list in GridProperty() is now unique
    • Fixed bug in Well: get_zonation_points
    • More fixes on pathlib (general rewrite) #332
  • Fixes for developers:
    • Replace logging methods in the C part, and relocated clib folder
    • Added code coverage in travis CI

2.7.1

  • Bugfig:
    • Issue with pathlib solved, #332

2.7.0

  • New features:
    • Support for petromod binary format for RegularSurface()
    • Added name attribute for Grid()
    • Enhanced plotting for well logs
    • The arrays stored Grid() are no longer SWIG C pointers, but numpy arrays. This simplifies pickling.
  • Bug fixes:
    • File names used in e.g. from_file should now handle pathlib instances
    • Improved error messages if issues with e.g. file names used in export/import
    • Fix of excessive logger output in
  • Fixes for developers:
    • General refactorizion of C code, to improve speed and stability. Also change logger method in C (still ongoing)

2.6.0

  • New features:
    • A Grid() instance can now be "numpified" so that pickling can be done, method numpify_carrays()
    • An existing GridProperty() instance should now accept scalar input which will be broadcasted to the full array
    • Added a method so one can create a GridProperty instance directly for a Grid() instance #291
    • Added several alternatives to instantate Points(), e.g. from a list of tuples
    • A general method that finds the IJK indices in a 3D grid from from Points() is made get_ijk_from_points #287
    • For RegularSurface(), the fill() methid will now accept an optional fill_value (constant) #294
  • Bug fixes:
    • Making surface write to BytesIO stream threading safe (Irap binary format)
    • Assigning a GridProperty() inside/outside a polygon is now more robust.
    • Many internal build fixes and improves, including requirements.txt
    • For surfaces, some operator overload function changed unintentionally the other instance #295
    • For surfaces, operator overload on instances with same topology will not unintentionally trigger resampling

2.5.0

  • New features:
    • Be able to write surfaces to BytesIO (memory streams), Linux only
    • Add the ability for 3D grids to detect and swap handedness of a 3D grid.
    • Available on Python 3.8 on all platforms
  • Fixes for developers
    • Now backward compatible to cmake 2.8.12
    • Many internal build fixes and improves, including requirements.txt

2.4.3

  • Fix of bugs when exporting points/polygons to Roxar API
  • Fix (for developers) various setup in cmake/swig etc so that cmake can be downgraded to 3.13.3 and hence a manylinux1 image is available in PYPI for Linux (Python versions < 3.7)

2.4.2

  • Fix a bug that occurs when reading Eclipse properties from E300 runs

2.4.1

  • Push to trigger travis build and deploy

2.4.0

  • New features:
    • Added a general kwargs to savefig() in plot module, so e.g. dpi keyword can be passed to matplotlib
  • Bug fixes:
    • More robust on reading saturations from UNRST files from Eclipse 300 and IX, where "IPHS" metadata (describing phases present) is unreliable.
  • Fixes for developers:
    • Setup can now be ran in "develop mode"

2.3.1

  • Preliminary support for Python 3.8 (Linux only)
  • Several bug fixes:
    • User warning when requested colour map is not found
    • Printing of a Points of Polygons instance shall now work
    • UNDEF values in property grdecl or bgrdecl export shall now be 0.0, not a large number
    • Name in GridProperty to_file(name=...) is fixed
    • If fformat in GridProperty import is mispelled, an exception will be raised

2.3.0

  • Added support for MacOS on PYPI (Python 3.6, 3.7)
  • Added functionality on grid slices as method ()
  • More flexible reading on phases present in Eclipse/IX UNRST files
  • Several minor bugfixes and improvements

2.2.2

  • Several smaller bug fixes
  • Use of realisation in gridproperty_from_roxar() was not working

2.2.1

  • Full C code and compile restructuring, now using scikit-build!
  • Use of realisation in gridproperty_from_roxar() was not working

2.2.0

Several fixes and new features, most important:

  • Well() class
    • Added tvd interval for rescaling of well logs.
    • When sampling a discrete property to well, it will now be a discrete log
    • Added a isdiscrete() method
  • RegularSurface() class
    • Support for read from bytestrings (memory) in addition to files (Irap binary format supported)
    • Fast load of surfaces (will only read metadata) if requested
    • Support for threading/multiprocessing (concurrent.futures) when importing surfaces from Irap binary.
  • Grid() class
    • Improvements and fixes for dual porosity and/or dual permeability models from Eclipse

2.1.0

Several fixes and new features, most important:

  • Cube() class

    • A general get_randomline() methods
  • Grid() class

    • Make a rectular shoebox grid
    • Get a randomline (sampling) along a 3D grid with property
    • More robust support for binary GRDECL format
    • Possible to input dual porosity models from Eclipse (EGRID, INIT, UNRST)
  • Surfaces

    • Added a class for Surfaces(), a collection of RegularSurface instances
    • Generate surface from 3D grid
    • Lazy load of RegularSurfaces (if ROFF/RMS binary) for fast scan of metadata
    • Clipboard support in from_roxar() and to_roxar() methods
    • fill(), fast infill of undefined values
    • smooth(), median smoothing
    • get_randomline() method (more general and flexible)
  • Points/polygons

    • Added copy() method
    • Added snap to surface method (snap_surface)
    • Several other methods related to xsections from polygons
  • Well() class

    • Get polygon and and improved fence from well trajectory
    • Look up IJK indices in 3D grid from well path

2.0.8

  • Fixed a backward compatibility issue with filter vs pfilter for points/polygons to_file

2.0.7

  • (merged into 2.0.8)

2.0.6

  • Corrected issues with matplotlib when loading xtgeo in RMS

2.0.5

  • Fixed a bug when reading grids in ROXAR API, the subgrids were missing
  • Improved logo and documentation runs
  • Allow for xtgeo.ClassName() as well as xtgeo.submodule.ClassName()
  • A number of smaller Fixes
  • More badges

2.0.4

  • Technical fixes regarding numpy versions vs py version, swig setup and setup.py

2.0.3

  • Deploy to python 3.4 and 3.5 also. Numpy versions tuned to match roxar library.

2.0.2

  • Adding services for code improvements (codacy, bandit)

2.0.1

  • Minor improvements in setup and documentation
  • Travis automatic deploy works now

2.0.0

  • First version after Open Sourcing to LGPL v3+

Version 0 and 1

See github for commit and tag history:

https://github.com/equinor/xtgeo

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

xtgeo-2.9.1b5-cp38-cp38-win_amd64.whl (520.7 kB view details)

Uploaded CPython 3.8Windows x86-64

xtgeo-2.9.1b5-cp38-cp38-manylinux2010_x86_64.whl (507.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

xtgeo-2.9.1b5-cp38-cp38-macosx_10_9_x86_64.whl (487.2 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

xtgeo-2.9.1b5-cp37-cp37m-win_amd64.whl (519.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

xtgeo-2.9.1b5-cp37-cp37m-manylinux2010_x86_64.whl (504.2 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

xtgeo-2.9.1b5-cp37-cp37m-macosx_10_9_x86_64.whl (485.6 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

xtgeo-2.9.1b5-cp36-cp36m-win_amd64.whl (519.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

xtgeo-2.9.1b5-cp36-cp36m-manylinux2010_x86_64.whl (504.2 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

xtgeo-2.9.1b5-cp36-cp36m-macosx_10_9_x86_64.whl (485.6 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

xtgeo-2.9.1b5-cp27-cp27mu-manylinux2010_x86_64.whl (504.0 kB view details)

Uploaded CPython 2.7mumanylinux: glibc 2.12+ x86-64

xtgeo-2.9.1b5-cp27-cp27m-manylinux2010_x86_64.whl (504.0 kB view details)

Uploaded CPython 2.7mmanylinux: glibc 2.12+ x86-64

File details

Details for the file xtgeo-2.9.1b5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 520.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 72495bfc3fcc502918ca5747c08efe3018d7014276714ec520d3b18715a0265d
MD5 5b1daa279f8a78dff70b1906fd0caf49
BLAKE2b-256 d74198f78ffdf876ae36502707b4d09788b607b67207da8fd957ebaceb41a573

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 507.1 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 293f20915abc480f9c51e44fbf3f3b8111e515ed4c8a950c037ba8ea5709a679
MD5 d639d2ea8be67b5ae38a0c12380dd38b
BLAKE2b-256 48f682da98c567a02589a880510562240b000a14b6ef06db8e9513abc0b33ef7

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 487.2 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 26f80b165e0e615bb90193cd83a816715f7250569bade3a19f7ec599d5751fb3
MD5 e6c3db1db675d10116a13aba6b7e1952
BLAKE2b-256 a95e5c811853a6342798f01944a1120b91c7afde38ddb60a0c5917d66870ec8b

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 519.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4348d4d8df4dcb08349a9d450904a9b72c2d12b901d080c883ca9aedbf7e730e
MD5 0a1fb26ca725e627a135841c6e539de8
BLAKE2b-256 99490099b61e48f376c3be077256687bcebec381d286244b5898b6612e6723db

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 504.2 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 901df4f49c23918c9396cd19aec7b8009cc41d407e39aa82202002f26f73245b
MD5 76671081ccd3a37b8cea9719e59fc42c
BLAKE2b-256 cd6a5e533a8b24501da80525dbb3a0f9bebaebf5d31df957f92049d855bf52f4

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 485.6 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ba9eb523524034eaa966fd10dfd04ae86b5cab7c65cd204ea42774845c885bee
MD5 3b6b816823a0b3d88f231a08d4477ebd
BLAKE2b-256 767b5e4cf4e7f2cdab3ffaf2a1e9ed8b2f0a51dba43a1fd153733fab988e4414

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 519.4 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1a7fd5d2c068716e0cfa975dc8180dc59778b5e30c8f3debb88912a8acd651b7
MD5 9e5a0743d18fdb2bcd7cefb1277c1316
BLAKE2b-256 18bf8c48e13289a97241cbdc8b9cea75563e40d99714e29fad56b209a931fa0b

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 504.2 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3f342e006c63485509c4cf68cf1b8da10fd02e3f2ae89a419c369b3e9f29d4a1
MD5 297b687f2f5a09c76cdf69624b0c5b11
BLAKE2b-256 7b3aea14e596c4087d506a73a53f370ac0c71f50f3f6cd7fb594fdb4769183e0

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 485.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 610899c8aded7dda3741f26c33e5a71be85ed4858af5f96bb3f111bfcfd7bc31
MD5 162dfd09316578f8f45cea168ad11ce2
BLAKE2b-256 6f0522dad03f765065c5ef139d2efeb197c7bd6dbf3c1137049f5cfaab9304a9

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp27-cp27mu-manylinux2010_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 504.0 kB
  • Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f9cf0b50a7eff17f30d23bd65cff43a3e617c2d26eac697fb0e9caa4c09f6b1b
MD5 aad8a0ab6bbd2ab68b683c63b33d0df4
BLAKE2b-256 e89994947e43be8c7fcd7b73390d97f53a16f3cb1efc1ed6dafd1c7e7797150e

See more details on using hashes here.

File details

Details for the file xtgeo-2.9.1b5-cp27-cp27m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: xtgeo-2.9.1b5-cp27-cp27m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 504.0 kB
  • Tags: CPython 2.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for xtgeo-2.9.1b5-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b323721fb25c15a15e446ee5ea4887f19b9eba14653d5fe36e0131d6a18c4428
MD5 633673aba9f57662cd4d9b347d58c1e3
BLAKE2b-256 fc53e7b59be66c19f46e874da650ee526846b9387bac149ed212b1cfaefa4665

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page