Working with Spectrum and Spectrum Phase Layers

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

Creating a Spectrum window

ISpectrumWindow spectrumWindow = ISpectrumWindow.factory.createWindow();

Creating a Spectrum Layer

In this example, we assume you have already created a seismic layer seismicLayer and a spectrum window spectrumWindow.

spectrumWindow.setReferenceLayer(seismicLayer);
NamedProps layerProperties = new NamedProps();
layerProperties.putProperty(ISpectrumLayer.USE_FULL_SECTION, true);
ISpectrumLayer layer = ISpectrumLayer.factory.createLayer(spectrumWindow, seismicLayer.getData(), layerProperties, false);

Creating a Spectrum Plot Window

ISpectrumPlotWindow spectrumPlotWindow = ISpectrumPlotWindow.factory.createWindow();

Creating a Spectrum Plot Layer

NamedProps windowProps = new NamedProps();
windowProps.putProperty(ISpectrumPlotWindow.SPECTRUM_TYPE, ISpectrumPlotWindow.AMPLITUDE);
spectrumPlotWindow.setProperties(windowProps);
spectrumPlotWindow.setReferenceLayer(seismicLayer);
NamedProps amplitudeLayerProperties = new NamedProps();
amplitudeLayerProperties.putProperty(ISpectrumPlotLayer.USE_FULL_SECTION, true);
ISpectrumPlotLayer layer = ISpectrumPlotLayer.factory.createLayer(spectrumPlotWindow, seismicLayer.getData(), amplitudeLayerProperties, false);