Skip to main content

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

Project description

XTGeo

Build Status Build status Code style: black PyPI version Codacy Badge 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.4+ is supported
  • 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
  • Integration with ROXAR API python for several data types is supported (see note later)
  • Linux is main development platform. From version 2.2.0, Windows 64bit is supported.

Installation

For Linux and Windows 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.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 (b)grdecl 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

This version

2.4.2

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

xtgeo-2.4.2-cp38-cp38-manylinux2010_x86_64.whl (473.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

xtgeo-2.4.2-cp37-cp37m-win_amd64.whl (481.2 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

xtgeo-2.4.2-cp37-cp37m-manylinux2010_x86_64.whl (473.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

xtgeo-2.4.2-cp37-cp37m-macosx_10_13_x86_64.whl (470.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.13+ x86-64

xtgeo-2.4.2-cp36-cp36m-win_amd64.whl (481.1 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

xtgeo-2.4.2-cp36-cp36m-manylinux2010_x86_64.whl (473.0 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

xtgeo-2.4.2-cp36-cp36m-macosx_10_13_x86_64.whl (470.1 kB view hashes)

Uploaded CPython 3.6m macOS 10.13+ x86-64

xtgeo-2.4.2-cp35-cp35m-manylinux2010_x86_64.whl (473.0 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

xtgeo-2.4.2-cp34-cp34m-manylinux2010_x86_64.whl (473.0 kB view hashes)

Uploaded CPython 3.4m manylinux: glibc 2.12+ x86-64

xtgeo-2.4.2-cp27-cp27mu-manylinux2010_x86_64.whl (472.4 kB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

Supported by

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