API / geotoolkit / seismic / data / RemoteSeismicDataSource / RemoteSeismicDataSource
data.RemoteSeismicDataSource.RemoteSeismicDataSource
Defines remote seismic data source
The data source communicate with server using JSON format via HTTP. It uses the following sequence of calls:
- get information about data source
- make query
- read a bunch of traces from creating query.
The supported query:
1. Get meta information about data set:
Input:{
"file" : fileName,
"type" : "info"
}Output:
{
"version": number,
"sourceId": number, // Used for optimization
"keys": [ {"key": name, "min":minValue, "max":maxValue, "increment":step } ],
"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": [ { "name":name, "id":number, "type":string, "size":bytes } ],"size":bytes
}
},Example:
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
Where query string parameters:
json:{"file":"seismicdata/cdp_stack.sgy","type":"info","query":{},"sourceId":-1}2. Get information about query.
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":[value1, value2, ...] }, //percentiles only if available
}Example of query string parameters:
json:{"file":"seismicdata/cdp_stack.sgy","type":"query","query":{},"sourceId":1169947804}3. Get binary data from the trace range
Input:{
"file" : fileName,
"type" : "traces",
"queryId": number, // Used for optimization. It is optional
"query": {
"keys": [
{
"name" : KeyName,
"min": minValue,
"max": maxValue,
"step": stepValue,
"order": asc or desc
},
// ...
]
},
"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
}4. Get binary data for an arbitrary path
Input:
{
"file" : fileName,
"type" : "traces",
"queryId": number, // Used for optimization. It is optional
"query": {
"keys": [
{"name" : KeyName1, "values": [values for key1]},
{"name" : KeyName2, "values": [values for key2]},
],
"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
}5. Release data source and/or query collection
{
"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(() => {
// Create query object
data.select(query, (reader) => {
// Create pipeline
});
}, (err) => {
// Error handling
}
);See
RemoteReaderDataProvider to have more information about output and input parameters
Constructors
Methods
Constructors
• new RemoteSeismicDataSource(options)
Creates data source
| Name | Type | Description |
|---|---|---|
options | Options | The options |
Methods
▸ getByteOrder(): ByteOrder
▸ getDataInfo(): Data | ParsedData
Returns the data info
options
▸ getHost(): string
Returns host name
string
▸ getKeys(): SeismicKey[]
Returns keys to make query
▸ getLodInfo(): { name: string ; value: string }[]
Returns Level Of Details
{ name: string ; value: string }[]
return level of details
▸ getMetaData(): SeismicMetaData
Returns seismic meta data information
▸ getRequestHeaders(): Record<string, string>
Returns request headers
Record<string, string>
options
▸ getSeismicFileName(): string
Returns file name
string
▸ getStatistics(): Statistics
Returns statistics
▸ isZSliceSupported(): boolean
Return true if source support Z slice. This information is available after opening data source
boolean
▸ open(callback, error?): void
This method open connection and load data source information
| Name | Type | Description |
|---|---|---|
callback | OpenCallback | is called then file is open |
Optional error | ErrorCallback | function with parameter data |
void
▸ release(): void
Notify server that reader resources can be released on server
void
▸ select(query, callback, error?): void
Returns a reader that provides a subset of this seismic data.
See class documentation for available queries.
Example
// A query by INLINE to select all XLINE traces form the range [0,1000] with empty traces
datasource.select({'keys': [
{
'name': 'INLINE',
'min': 500,
'max': 500,
'step': 1,
'order': 'asc'
},
{
'name': 'XLINE',
'min': 0,
'max': 1000,
'step': 1,
'order': 'asc'
}
],
'emptyTracesKey' {
'name': 'XLINE',
'min': 0,
'max': 1000
}
}, (reader) => {
...
});Example
// Query by path
datasource.select({ 'emptyTraces': true,
'queryType': 'seismicPath',
'keys': [{
'name': 'INLINE',
"values": [100, 200, 200]
}, {
'name': 'XLINE',
'values': [200, 400, 500]
}]
}, (reader) => {
...
});| Name | Type | Description |
|---|---|---|
query | Query | query object |
callback | SelectCallback | The callback function to be called on success, will be called with the resulting reader as a parameter |
Optional error | ErrorCallback | The callback function to be called on error, will be called with the actual error as a parameter |
void