Implementing Your Own Seismic Format Loading

If you have your own seismic file format which is not implemented in INTViewer, you can create your own plugin reading that format.

If the number of traces is low and can be loaded in memory, consider using MemorySeismicData. If loading all traces in memory is not possible, follow these four basic steps:

  1. Implement and register a class which extends org.openide.loaders.MultiDataObject. Details on how to register that data object are provided here.
  2. Implement a class which implements com.interactive.intviewerapi.data.seismic.ISeismicData.
  3. Implement a class which implements com.interactive.intviewerapi.data.seismic.ISeismicReader.
  4. Implement a class which implements com.interactive.intviewerapi.data.seismic.ITrace.

An example NetBeans project has been archived in the DemoSeismicData.zip file attached at the end of this page.

This module reads a very simple seismic file format, so that this example project will be easy to follow. In this seismic file format, the sample values are listed underneath a "#Sample Values" comment line. Sample values are listed as one trace per line, with a space delimiting each value. The header values are listed underneath a "#Header Values" comment line. Header values are listed as one trace per line, with the headers in order being INLINE, XLINE, CDPX, CDPY.

This project provides a basic implementation of a seismic format parsing and data loading.

Two sample implementations are provided. One where the 2 keys are "TraceNumber" and "Time", one where 3 keys are "INLINE", "XLINE" and "Time".

In the example with 2 keys:

  1. DemoTwoDSeismicDataObject extends org.openide.loaders.MultiDataObject
  2. DemoTwoDSeismicData implements com.interactive.intviewerapi.data.seismic.ISeismicData
  3. DemoTwoDSeismicReader implements com.interactive.intviewerapi.data.seismic.ISeismicReader
  4. DemoTwoDSeismicTrace implements com.interactive.intviewerapi.data.seismic.ITrace

In the example with 3 keys:

  1. DemoThreeDSeismicDataObject extends org.openide.loaders.MultiDataObject
  2. DemoThreeDSeismicData implements com.interactive.intviewerapi.data.seismic.ISeismicData
  3. DemoThreeDSeismicReader implements com.interactive.intviewerapi.data.seismic.ISeismicReader
  4. DemoThreeDSeismicTrace implements com.interactive.intviewerapi.data.seismic.ITrace

Both implementations share the same structure: upon loading the file, the entire content is read, and a map of "trace indexes vs line numbers" is created. When a trace needs to be accessed, this map is used to find the matching line in the file and this line is then parsed. To speed up access, all first 5000 lines that match a query are prefetched instead of accessing lines one by one. Beyond 5000 lines, each line is accessed one by one, which is slow.

This is an simple example. In your own implementation, you will probably have your own map built-in your file format, you will probably use random file access and you might even implement some trace caching.

When implementing your own, remember to:

  • detect the natural increment of your seismic data (and return matching ISeismicKeyRange instances in ISeismicData.getDataRange())
  • support all query types (SeismicRangeQuery, but also SeismicPathQuery and SeismicDiscreteQuery)
  • support empty traces for SeismicRangeQuery and SeismicPathQuery
  • support decimation (take into account the increment in SeismicKeyRange in seismic range queries)
  • support sorting (take into account the sorting in SeismicKeyRange in seismic range queries)
  • support map seismic range queries (ISeismicData.ORDER_MAP) in addition to XSection seismic range queries (ISeismicData.ORDER_XSECTION)
  • be compatible with the session mechanism (implement IPersistent)

You can simply run this project, and open the .demo2d file (attached at the end of this page) in a XSection window just like you would any other seismic file. The .demo3d file can be opened up both in XSection or 3d windows.

Here is an example of visualization in 2D (using the attached file seismicFile.demo2d):

Here is an example of visualization in 3D (using the attached file seismicFile.demo3d):

Implementing your own seismic format parsing can be complicated. Your project will have greater chances of success if you start by testing the data access part using MemorySeismicData. Once you have a working MemorySeismicData implementation, switch to the real-world implementation.