Working With 2D Seismic Layers

Note: you will need to include SeismicData and Seismic2D in your Module Dependencies list in addition to Viewer2D.

Creating a seismic 2D layer for a XSection window

In this example, we assume you have already created a seismic dataset seismicData and a XSection window xsectionWindow. See section Working With Seismic Data for examples on how to create a seismic dataset. Also, see section Working With Windows to find more information on how to create and set attributes for a XSection window.

    import com.interactive.intviewerapi.layers.ISeismicLayer;
    import com.interactive.intviewerapi.layers.NamedProps;
    NamedProps layerProperties = new NamedProps();
    layerProperties.putProperty(ISeismicLayer.PLOT_TYPE, ISeismicLayer.WIGGLE | ISeismicLayer.POSITIVE_FILL);
    layerProperties.putProperty(ISeismicLayer.SCALE, 2.0f);
    ISeismicLayer layer = ISeismicLayer.factory.createLayer(xsectionWindow, seismicData, layerProperties, false); // false means no editor popup

In the example above, a seismic layer is created and automatically inserted as the top layer into a XSection layer. The seismic display type is set to wiggle with positive fill. A scale of 2.0 is set. Each layer interface has a factory member that points to the factory for creating that layer.

Changing the color map of a seismic 2D layer in a XSection window

You will need to add IntUtil to your Module Dependencies list.

    import com.interactive.util.gui.coloreditor.cgColorMap;
    ...
    Color[] myColorMap = new Color[]{
        new Color(255, 51, 0, 255), new Color(255, 63, 3, 255),
        new Color(255, 76, 6, 255), new Color(255, 89, 9, 255),
        new Color(255, 102, 12, 255), new Color(255, 114, 15, 255),
        new Color(255, 127, 19, 255), new Color(255, 140, 22, 255),
        new Color(255, 153, 25, 255), new Color(255, 165, 28, 255),
        new Color(255, 178, 31, 255), new Color(255, 191, 35, 255),
        new Color(255, 204, 38, 255), new Color(255, 216, 41, 255),
        new Color(255, 229, 44, 255), new Color(255, 242, 47, 255),
        new Color(255, 255, 51, 255), new Color(241, 238, 61, 255),
        new Color(227, 221, 71, 255), new Color(214, 204, 81, 255),
        new Color(200, 187, 91, 255), new Color(187, 170, 102, 255),
        new Color(173, 153, 112, 255), new Color(159, 136, 122, 255),
        new Color(146, 119, 132, 255), new Color(132, 102, 142, 255),
        new Color(119, 85, 153, 255), new Color(105, 68, 163, 255),
        new Color(91, 51, 173, 255), new Color(78, 34, 183, 255),
        new Color(64, 17, 193, 255), new Color(51, 0, 204, 255)};
        cgColorMap colorMap = new cgColorMap();
        colorMap.setRampSize( myColorMap.length);
        for (int i = 0; i <  myColorMap.length; i++) {
            colorMap.setColor(i,  myColorMap[i]);
        }
        ISeismicLayer seismicLayer = ...
        NamedProps props = new NamedProps();
        props.putProperty(ISeismicLayer.COLORMAP, myColorMap);
        seismicLayer.setProperties(props);

To create a default color map (showing a grayscale gradient), just use:

cgColorMap colorMap = new cgColorMap();

Selecting the traces to be displayed in a XSection window

The ISeismicLayer interface has a select method which let you select which traces are to be displayed. A query must be specified. The following shows how to perform a query that specifies a specific INLINE value and a time range.

    import com.interactive.intviewerapi.data.query.SeismicRangeQuery;
    ...
    SeismicRangeQuery query = new SeismicRangeQuery(ISeismicData.ORDER_XSECTION);
    SeismicKeyRange inlineRange = new SeismicKeyRange("INLINE", 892, 892);
    query.addKeyRange(inlineRange);

Once the query has been constructed, you can simply call the select as follows:

    ISeismicLayer layer = ...
    layer.select(query);

or if you also want to control the time range:

    ISeismicLayer layer = ...
    layer.select(query, 1.0, 3.0);

Internally, the layer will perform a select on the underlying ISeismicData object and use the returned ISeismicReader to access the traces. You can access a copy of the ISeismicReader used by the layer if you need to access the same set of traces.

    ISeismicReader reader = layer.getReader();

You can also query directly the underlying ISeismicData if you need to access a different subset of traces than the one displayed by the layer. See section Working With Seismic Data for more information on how to read trace and header values.

The code below, shows a complete example where we select the first inline of a dataset, select it and synchronize it (so that users can navigate through the inlines using the + or - navigation buttons). Note that you don't need to use explicit key names as the keys returned by getDataRange are always sorted from the slowest (typically the Inline key ) to the fastest (typically the Time/Depth key).

    List<IKeyRange> keyRangeList = seismicData.getDataRange();
    SeismicKeyRange range = new SeismicKeyRange(keyRangeList.get(0));
    range.setMaximum(range.getMinimum());
    SeismicRangeQuery query = new SeismicRangeQuery(ISeismicData.ORDER_XSECTION);
    query.addKeyRange(range);
    layer.select(query);
    layer.setSynchronized(keyRangeList.get(0).getName(), true);

Setting the offset of a XSection seismic layer

This option corresponds to the offset column displayed in the "Data" tab of a seismic layer properties.

You can set the offset to a single value:

    ISeismicLayer layer = ...
    layer.setMinimumOffset("INLINE", 4);
    layer.setMaximumOffset("INLINE", 4);

You can set the offset to an interval:

    ISeismicLayer layer = ...
    layer.setMinimumOffset("INLINE", -4);
    layer.setMaximumOffset("INLINE", 4);

Creating a seismic layer (time slice) for a Map window

To display a seismic volume as a time slice in a map view, you must have transposed the traces beforehand. With a seismic dataset seismicData and a window mapWindow, you can create a seismic map layer as follows:

    import com.interactive.intviewerapi.layers.IMapSeismicLayer;
    ...
    NamedProps layerProperties = new NamedProps();
    layerProperties.putProperty(IMapSeismicLayer.IS_INTERPOLATED, true);
    layerProperties.putProperty(IMapSeismicLayer.SCALE, 2.0f);
    IMapSeismicLayer mapLayer = IMapSeismicLayer.factory.createLayer(mapWindow, seismicData, layerProperties, false);

By default, the time slice layer is meant to be used with seismic datasets with 3 keys (ex: INLINE, XLINE, Time). In some cases, you might want to visualize the time slice of a 4D dataset. In this case, you need to load the dataset in memory and indicate which volume keys should be used (ex: INLINE, XLINE). Use the IMapSeismicLayer.LOAD_IN_MEMORY_FORMAT, IMapSeismicLayer.INLINE_KEY_NAME and IMapSeismicLayer.XLINE_KEY_NAME properties in this case.

    import com.interactive.intviewerapi.layers.IMapSeismicLayer;
    ...
    NamedProps layerProperties = new NamedProps();
    layerProperties.putProperty(IMapSeismicLayer.IS_INTERPOLATED, true);
    layerProperties.putProperty(IMapSeismicLayer.SCALE, 2.0f);
    layerProperties.putProperty(IMapSeismicLayer.INLINE_KEY_NAME, "INLINE");
    layerProperties.putProperty(IMapSeismicLayer.XLINE_KEY_NAME, "XLINE);
    layerProperties.putProperty(IMapSeismicLayer.LOAD_IN_MEMORY_FORMAT, IMapSeismicLayer.MEMORY_BYTE);
    IMapSeismicLayer mapLayer = IMapSeismicLayer.factory.createLayer(mapWindow, seismicData, layerProperties, false);

Selecting the time slice to be displayed

By default the layer will display the first time slice. To select a different time for the slice to be displayed, you can use method setTimeSlice as follows:

    mapLayer.setTimeSlice(2.0);

You can also control if the Time key is to be synchronized or not (to listen to time broadcast and respond to increment/decrement actions from the + or - navigation buttons):

    mapLayer.setSynchronizeTimeSlice(true);

Creating a seismic outline layer for a Map window

If you don't have a transposed volume and you don't want to load the traces in memory, you can still display the seismic data as an outline in a map view as follows:

    import com.interactive.intviewerapi.layers.IOutlineMapSeismicLayer;
    ...
    IMapOutlineSeismicLayer outlineLayer = IMapOutlineSeismicLayer.factory.createLayer(mapWindow, seismicData, new NamedProps(), false);

Creating a seismic line layer for a Map mindow

    import com.interactive.intviewerapi.layers.IMapSeismicLineLayer;
    ...
    mapWindow.setDisplayMode(ICRSProvider.XY);
    NamedProps props = new NamedProps();
    props.putProperty(IMapSeismicLineLayer.X_KEY_NAME, "CDPX");
    props.putProperty(IMapSeismicLineLayer.Y_KEY_NAME, "CDPY");
    props.putProperty(SeismicProperties.ANNOTATION_KEY_NAME, "TraceNumber");
    IMapSeismicLineLayer lineLayer = IMapSeismicLineLayer.factory.createLayer(mapWindow, seismicData, props, false);

Adding trace processors to a seismic layer

Follow this walkthrough to plug your own trace processors.

You can add trace processors by class:

    ISeismicLayer layer = ...
    ISeismicProcessor processor = ISeismicProcessor.Factory.getInstance(layer, MyTraceProcessor.class);
    layer.getAllSeismicProcessors().add(processor);
    layer.applyAllSeismicProcessors();

You can add trace processors by name:

    ISeismicLayer layer = ...
    ISeismicProcessor processor = ISeismicProcessor.Factory.getInstance(layer, "AGC");
    layer.getAllSeismicProcessors().add(processor);
    layer.applyAllSeismicProcessors();