Skip to content
Last updated

API / geotoolkit / seismic / data / RemoteSeismicDataSource / RemoteSeismicDataSource

Class: RemoteSeismicDataSource

data.RemoteSeismicDataSource.RemoteSeismicDataSource

Defines remote seismic data source

<p> The data source communicate with server using JSON format via HTTP. It uses the following sequence of calls: </p> <ul> <li>get information about data source</li> <li>make query</li> <li>read a bunch of traces from creating query.</li> </ul>

<p> The supported query: </p> <h3>1. Get meta information about data set:</h3> Input:

{
"file" : fileName,
"type" : "info"
}

<p/> Output:

{
"version": number,
"sourceId": number, // Used for optimization
"keys": &#91; {"key": name, "min":minValue, "max":maxValue, "increment":step } &#93;,
"numberOfSamples": value,
"numberOfTraces": value,
"sampleRate": value,
"startValue": value,
"zUnit": value,
"statistics": { "min":value, "max":value, "average":value, "rms":value },
"units": value, //cgUnits value
"traceHeader": {
"fields": &#91; { "name":name, "id":number, "type":string, "size":bytes } &#93;,"size":bytes
}
},

Example: <br> http://localhost:8080/seismicreader?json=%7B%22file%22:%22seismicdata/cdp_stack.sgy%22,%22type%22:%22info%22,%22query%22:%7B%7D,%22sourceId%22:-1%7D <p/> Where query string parameters:

json:{"file":"seismicdata/cdp_stack.sgy","type":"info","query":{},"sourceId":-1}

<h3>2. Get information about query.</h3>

Input:

{
"file" : fileName,
"type" : "query",
"sourceId": number, // Used for optimization. It is optional
"queryId": number, // Used for optimization. it is optional
"query": {
// See available queries in 3. and 4.
}
}

Output:

{
"version": number,
"queryId": number, // Used for optimization
"numberOfSamples": value,
"numberOfTraces": value,
"sampleRate": value,
"startValue": value,
"statistics": { "min":value, "max":value, "mean":value, "average":value, "rms":value, "percentiles":&#91;value1, value2, ...&#93; }, //percentiles only if available
}

Example of query string parameters:

json:{"file":"seismicdata/cdp_stack.sgy","type":"query","query":{},"sourceId":1169947804}

<h3>3. Get binary data from the trace range</h3> Input:

{
"file" : fileName,
"type" : "traces",
"queryId": number, // Used for optimization. It is optional
"query": {
"keys": &#91;
{
"name" : KeyName,
"min": minValue,
"max": maxValue,
"step": stepValue,
"order": asc or desc
},
// ...
&#93;
},
"data" : {
"startTrace": startTrace,
"endTrace": endTrace,
"samples": "true", // or "false",
"headers": "true", // or "false"
"byteOrder": "LITTLE_ENDIAN", "BIG_ENDIAN0"
}
}

Output: Binary data. It returns block (endTrace-startTrace+1). Each trace has HEADER and SAMPLES. The header size equals to information from metadata, Samples size equals (4 * samplesCount) The full size of the data block is (endTrace - startTrace + 1) * (headerSize + samplesSize) The samples are returned as float

Example of query string parameters:

json: {
"file":"seismicdata/cdp_stack.sgy",
"type":"traces",
"query":{},
"data": {
"startTrace":0,
"endTrace":255,
"samples":true,
"headers":true,
"byteOrder":"LITTLE_ENDIAN"
},
"sourceId":1169947804,
"queryId":1169945598
}

<h3>4. Get binary data for an arbitrary path</h3>

Input:

{
"file" : fileName,
"type" : "traces",
"queryId": number, // Used for optimization. It is optional
"query": {
"keys": &#91;
{"name" : KeyName1, "values": [values for key1&#93;},
{"name" : KeyName2, "values": &#91;values for key2&#93;},
],
"queryType": "seismicPath",
'emptyTraces': true,
},

"data" : {
"startTrace": startTrace,
"endTrace": endTrace,
"samples": "true" or "false",
"headers": "true" or "false"
"byteOrder": "LITTLE_ENDIAN", "BIG_ENDIAN0"
}
}

Output: Binary data. It returns block (endTrace-startTrace+1). Each trace has HEADER and SAMPLES. The header size equals to information from metadata, Samples size equals (4 * samplesCount) The full size of the data block is (endTrace - startTrace + 1) * (headerSize + samplesSize) The samples are returned as float

Example of query string parameters:

json: {
"file":"seismicdata/cdp_stack.sgy",
"type":"traces",
"query":{},
"data": {
"startTrace":0,
"endTrace":255,
"samples":true,
"headers":true,
"byteOrder":"LITTLE_ENDIAN"
},
"sourceId":1169947804,
"queryId":1169945598
}

<h3>5. Release data source and/or query collection</h3>

{
"sourceId": number,
"queryId": number, // optional
"type" : "release"
}

Throws

if version of provider is not supported.

Example

import {RemoteSeismicDataSource} from '@int/geotoolkit/seismic/data/RemoteSeismicDataSource';
const data = new RemoteSeismicDataSource({
'host': 'https://demo.int.com/INTGeoServer/json',
'file': 'data/seismic/Gullfaks_Amplitude.xgy',
'version': 2
});
// request data source
data.open(() =&gt; {
// Create query object
data.select(query, (reader) =&gt; {
// Create pipeline
});
}, (err) =&gt; {
// Error handling
}
);

See

RemoteReaderDataProvider to have more information about output and input parameters

Table of contents

Constructors
  • [new RemoteSeismicDataSource(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.seismic.data-3.remoteseismicdatasource.remoteseismicdatasource.md#new remoteseismicdatasource(options))
Methods

Contents

Constructors

new RemoteSeismicDataSource(options)

• new RemoteSeismicDataSource(options?)

Creates data source

Parameters

Name Type Description
Optional optionsOptionsThe options
Methods

createReader

▸ Protected createReader(data, query, endianness, decimatedData?): RemoteSeismicReader

Creates a reader

Parameters

Name Type Description
dataQueryDataThe data
queryQueryThe query
endiannessByteOrderThe endianness
Optional decimatedDataanyThe decimated data

Returns

RemoteSeismicReader

The reader


getByteOrder

▸ getByteOrder(): ByteOrder

Returns

ByteOrder


getClassName

▸ getClassName(): string

Returns

string


getDataInfo

▸ getDataInfo(): Data | ParsedData

Returns the data info

Returns

Data | ParsedData

options


getHost

▸ getHost(): string

Returns host name

Returns

string


getKeys

▸ getKeys(): SeismicKey[]

Returns keys to make query

Returns

SeismicKey[]


getLodInfo

▸ getLodInfo(): { name: string ; value: string }[]

Returns Level Of Details

Returns

{ name: string ; value: string }[]

return level of details


getMapTraceHeader

▸ Protected getMapTraceHeader(): BinaryHeader

Returns map trace header

Returns

BinaryHeader

map trace header


getMetaData

▸ getMetaData(): SeismicMetaData

Returns seismic meta data information

Returns

SeismicMetaData


getOptions

▸ Protected getOptions(): any

Returns options

Returns

any

options


getRequestHeaders

▸ getRequestHeaders(): Record<string, string&gt;

Returns request headers

Returns

Record<string, string&gt;

options


getSeismicFileName

▸ getSeismicFileName(): string

Returns file name

Returns

string


getStatistics

▸ getStatistics(): Statistics

Returns statistics

Returns

Statistics


getTraceHeader

▸ Protected getTraceHeader(): BinaryHeader

Returns trace header

Returns

BinaryHeader

trace header


isZSliceSupported

▸ isZSliceSupported(): boolean

Return true if source support Z slice. This information is available after opening data source

Returns

boolean


open

▸ open(callback, error?): void

This method open connection and load data source information

Parameters

Name Type Description
callbackOpenCallbackis called then file is open
Optional errorErrorCallbackfunction with parameter data

Returns

void


release

▸ release(): void

Notify server that reader resources can be released on server

Returns

void


select

▸ select(query, callback, error?): void

Returns a reader that provides a subset of this seismic data.<br> See class documentation for available queries.<br>

Example

// A query by INLINE to select all XLINE traces form the range &#91;0,1000&#93; with empty traces
datasource.select({'keys': &#91;
{
'name': 'INLINE',
'min': 500,
'max': 500,
'step': 1,
'order': 'asc'
},
{
'name': 'XLINE',
'min': 0,
'max': 1000,
'step': 1,
'order': 'asc'
}
&#93;,
'emptyTracesKey' {
'name': 'XLINE',
'min': 0,
'max': 1000
}
}, (reader) =&gt; {
...
});

Example

// Query by path
datasource.select({ 'emptyTraces': true,
'queryType': 'seismicPath',
'keys': &#91;{
'name': 'INLINE',
"values": [100, 200, 200&#93;
}, {
'name': 'XLINE',
'values': &#91;200, 400, 500&#93;
}]
}, (reader) =&gt; {
...
});

Parameters

Name Type Description
queryQueryquery object
callbackSelectCallbackThe callback function to be called on success, will be called with the resulting reader as a parameter
Optional errorErrorCallbackThe callback function to be called on error, will be called with the actual error as a parameter

Returns

void


getClassName

▸ Static getClassName(): string

Returns

string