Python

WMPlugins 6.6.10 Release

Announcing the release of version 6.6.10 of the WMPlugins a suite of opensource plugins that extend the opensource seismic interpretation system OpendTect. This release is built against OpendTect 6.6.7.

Continue reading

First Release of Python Bindings to OpendTect

The 6.6.8 release of the WMPlugins includes a Python module, wmodpy, to access OpendTect survey and well information. Unlike OpendTect’s existing odpy module, wmodpy is a direct binding to the OpendTect C++ code.

Continue reading

Seismic Modelling and Inversion using PyLops based Python External Attributes

The 6.6.8 release of the WMPlugins includes a number of new Python external attribute scripts that use the PyLops linear operator library for seismic modelling and inversion. These scripts also demonstrate the use of the new user interface parameter elements introduced in the 6.6.8 release of the External Attribute plugin.

Continue reading

Using Visual Studio Code with OpendTect

In this post I show you how to set up and use the free Visual Studio Code editor with OpendTect for interactive computation using Python Jupyter Notebooks. If you have installed the OpendTect Machine Learning Python environments you can create and edit Python Jupyter Notebooks using Visual Studio Code without modifying the installed environment provided VS Code is run from within OpendTect. The approach described in this post might assist users in strictly controlled IT settings get up and running using Jupyter Notebooks.

Continue reading

Python External Attribute Tips & Tricks - Debugging

Introduction Because the Python [../plugins/ExternalAttrib] script is running in a process started by the OpendTect application most standard methods to examine the script as it runs, eg using the standard Python debugger pdb, are not available. A solution is to use the Web-PDB Python module which allows the Python script to be debugged remotely in a web-browser. Web-PDB Installation Web-PDB is not included by default in most Python installations but it can be easily added using pip:

Continue reading

Python External Attribute Tips & Tricks - Logging

Introduction It is possible to write information to the OpendTect logfile from inside a Python [../plugins/ExternalAttrib] script. The global variable xa.logH (assuming the extattrib module has been imported using import extattrib as xa) is a Python logger object. An Example On line 18 the Python logger is modified by adjusting the severity level of messages that will appear in the log file. By default only CRITICAL, ERROR and WARNING messages will be written.

Continue reading

Anatomy of a Python External Attribute

Introduction This article will review the structure of a simple Python [../plugins/ExternalAttrib] script, ex_dip.py, which converts inline and crossline dip to true dip and dip azimuth. It is an example of multi attribute, single trace input and output. Some basic understanding of Python and Numpy is assumed. Every Python attribute script has 5 sections. The Imports Imports Section This is where external modules/libraries required by the script are loaded. At a minimum the script must load:

Continue reading