API / geotoolkit / seismic / data / CachingReader / CachingReader
data.CachingReader.CachingReader
A seismic reader that keeps all traces in memory. This Reader is the Proxy for any SeismicReader. It saves traces in inner cache at the first request and gives them from cache at the following requests.
| Name | Type |
|---|---|
T | extends SeismicReader = SeismicReader |
↳
CachingReader
Methods
Constructors
• new CachingReader<T>(seismicReader, memoryLimit)
Created reader
| Name | Type |
|---|---|
T | extends SeismicReader<T> = SeismicReader |
| Name | Type | Description |
|---|---|---|
seismicReader | T | instance of SeismicReader that will be proxied |
memoryLimit | number | Memory limit in Megabytes |
SeismicReader.constructor
Methods
▸ Protected copyConstructor(src, deepCopy?): CachingReader<T>
Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.
| Name | Type | Description |
|---|---|---|
src | SeismicReader | Source to copy from |
Optional deepCopy | boolean | deep copy |
this
▸ dispose(): void
Dispose.
void
▸ getClassName(): string
string
▸ getMetaData(): SeismicMetaData
proxy to original reader
▸ getModelLimits(): Rect
proxy to original reader
▸ getNullValue(): number
proxy to original reader
number
▸ getNumberOfSamples(): number
proxy to original reader
number
SeismicReader.getNumberOfSamples
▸ getNumberOfTraces(): number
proxy to original reader
number
SeismicReader.getNumberOfTraces
▸ getOptions(): ReturnType<T["getOptions"]>
proxy to original reader
ReturnType<T["getOptions"]>
▸ getOriginalMetaData(): SeismicMetaData
Returns seismic original meta data information before any decimation
SeismicReader.getOriginalMetaData
▸ getSampleRate(): number
proxy to original reader
number
▸ getStatistics(): Statistics
proxy to original reader
min, max, average, rms
▸ getTimeStamp(): number
Return the value to indicate if data was changed
number
▸ getTraceHeaderFields(): FieldDesc[]
proxy to original reader
SeismicReader.getTraceHeaderFields
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
SeismicReader.hasEventListener
▸ invalidate(rect?): void
Invalidate data and notify that data is changed
| Name | Type | Description |
|---|---|---|
Optional rect | Rect | optional area of tracers and samples to invalidate. It is not supported now |
void
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ loadMetaData(callback): void
proxy to original reader
| Name | Type |
|---|---|
callback | (reader: SeismicReader) => void |
void
▸ notify<E>(type, source, args?): CachingReader<T>
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | SeismicReader | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): CachingReader<T>
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: CachingReader<T>, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): CachingReader<T>
Attach listener on event that will be called whenever the specified event is delivered to the target
If the callback function is already in the list of event listeners for this target, the function is not added a second time.
If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: CachingReader<T>, args: EventMap[E]) => void | to be called |
this
▸ queryInterface<T>(someInterface): InstanceType<T>
Returns interface, if reader can provide it
| Name | Type |
|---|---|
T | extends Constructor<any> |
| Name | Type | Description |
|---|---|---|
someInterface | T | interface |
InstanceType<T>
internal instance of this interface
▸ select(query, callback): Promise<unknown>
returns seismic trace section
Example
// to read a specific range of traces
reader.select({
'from': 10,
'to': 20
}, (fetchResult) => {
// fetchResult is instance of @int/geotoolkit/seismic/data/QueryResult
fetchResult.foreach((index, section) => {
for (let i = 10; i <= 20; i++) {
console.log(section.getTrace(i));
}
});
});Example
// selection by trace indices
reader.select({
'traceIndexes': [15, 20]
}, (fetchResult) => { ... });| Name | Type | Description |
|---|---|---|
query | SelectQuery | this specifies the condition of the request |
callback | SelectCallback | method to be called when data is ready |
Promise<unknown>
▸ setCacheSize(memoryLimit): CachingReader<T>
Sets memory limit in Megabytes. Attention! Removes all existing traces from cache.
| Name | Type | Description |
|---|---|---|
memoryLimit | number | Memory limit in Megabytes |
this
▸ setSilent(bool): CachingReader<T>
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ update(options?, callback?): void
Update seismic query and returns meta information
| Name | Type | Description |
|---|---|---|
Optional options | Record<string, any> | this specifies the condition of the request |
Optional callback | UpdateCallback | method to be called when data is ready |
void
▸ Protected updateTimeStamp(): void
Update time stamp
void
▸ Static getClassName(): string
string