Programming in and around OpendTect; Part 2: Python

Programming in and around OpendTect; Part 2: Python

In this series of 6 social media posts we describe different ways of programming software in and around OpendTect. The various options are listed in the Table below.

Today: Python.

The free External Attribute plugin makes it possible to develop new seismic attributes for OpendTect in Python, a popular open source, high-level, general-purpose, interpreted, dynamic programming language. The External Attribute plugin is part of a package of free plugins provided by Wayne Mogg, download links and installation instructions are provided on the plugin documentation site. As of release 6.0.4 the plugin package also includes a collection of Python external attribute scripts that can be used as is or referred to as examples for development of new attributes.

To create and run Python attribute scripts an installation of Python version 3+ is also required. The recommended solution is to install the free Anaconda Python distribution for you platform. Remember to get a version 3+ package as earlier versions are not supported by the plugin. Out of the box Anaconda comes with a range of handy Python extensions for numerical computation such as Numpy, SciPy and Numba.

As a simple example consider the following Python attribute script that applies a Prewitt (derivative) filter.

Approximately 800 lines of C++ code would be required to implement this same functionality as a C++ OpendTect plugin. Despite this simplicity, a Python attribute has all the benefits of a native OpendTect attribute:

●     It can be displayed in all the same places.

●     It can be used as input to other attributes either native or another Python attribute.

●     It can be used in crossplots.

●     It supports parallel processing.

●     It can be used to generate new seismic volumes via the OpendTect batch processing facility.

Naturally the execution time of a Python attribute will be longer than an equivalent C++ attribute, however this is offset by a more rapid development cycle using a higher level language. Each change to the code of a C++ attribute requires a compile, link and OpendTect shutdown-restart. A change to the Python attribute can be tested by simply redisplaying the attribute.

There is the flexibility to develop something as simple as a single trace filter or as complex as an attribute with multi-trace, multi-attribute input and multi-attribute output. Here is an example of a moderately complex attribute (ex_lpa_smooth.py) that implements a structure preserving filter using 3D, weighted least squares, local polynomial approximation.

Fingers crossed you now want to make your own Python attributes. A good way to start is to download or clone my GitHub repository of Python attributes and see how anything from low pass filtering to computation of gradient structure tensors is possible. In the skeletons folder you will find Python templates for scripts of various input/output complexity to start from. Leave a message on the GitHub issue tracker if you need help or discover a bug. Get coding.

 Author: Wayne Mogg




Coerte A. Voorhies, III

InsightEarth Software Consultant at EdgeSeis LLC

8 å¹´

I would like to try this. Thank you.

Anton Starovoitov

Geophysicist | Geoscientist | Certified PMP? Project Manager

8 å¹´

This is something I was waiting for! Great job, dGB team!

Dr. Jesper Dramsch

I talk about non-hype AI {Scientist for Machine Learning @ECMWF ?? | Fellow AI4Science @SSI ?? | PhD @DTU ?? | Partner @Youtube ?? | Top 81 @Kaggle code ??}

8 å¹´

I am inclined to take a look indeed. Thanks for providing this easy but powerful tool!

要查看或添加评论,请登录

Marieke van Hout - de Groot的更多文章

  • Horizon curvature and volume curvature attributes in OpendTect

    Horizon curvature and volume curvature attributes in OpendTect

    The curvedness of a surface can be captured in a set of attributes that are collectively called curvature attributes…

    1 条评论
  • Maps in OpendTect

    Maps in OpendTect

    In OpendTect you can display maps in the form of images in a 3D scene. To achieve this you need to add two images and…

    2 条评论
  • Forward modeling in OpendTect - Reducing risks and uncertainty

    Forward modeling in OpendTect - Reducing risks and uncertainty

    We have a new tool in SynthRock. SynthRock is OpendTect’s forward modeling and stochastic inversion plugin.

    4 条评论
  • OpendTect - Free self training

    OpendTect - Free self training

    Did you know that you can access all the commercial plugins of OpendTect Pro in the F3 demo training data set? We often…

    2 条评论
  • MOL sponsors Machine Learning Project in OpendTect Pro

    MOL sponsors Machine Learning Project in OpendTect Pro

    MOL Norge AS, a subsidiary of the Hungarian oil company MOL, is funding an R&D project that will extend OpendTect’s…

  • Automatic extraction of fault planes

    Automatic extraction of fault planes

    Fig. 1: Automatically extracted fault planes from fault likelihood.

    4 条评论
  • Improve imaging results with a simple display trick

    Improve imaging results with a simple display trick

    Thinned Fault Likelihood (TFL) is OpendTect’s preferred attribute for imaging faults. The attribute shows razor-sharp…

    6 条评论
  • Super fast new algorithm to compute seismic dips

    Super fast new algorithm to compute seismic dips

    We released a very fast new algorithm in the dip-steering plugin. With this algorithm inline - and crossline dips are…

    5 条评论
  • SynthRock/ HitCube Seismic Predictions

    SynthRock/ HitCube Seismic Predictions

    Fig.1 Random line through key wells.

  • New Free Spectral Decomposition algorithms in OpendTect v6.2.3

    New Free Spectral Decomposition algorithms in OpendTect v6.2.3

    We have released 3 new Spectral Decomposition algorithms in the free part of OpendTect version 6.2.

    7 条评论

社区洞察

其他会员也浏览了