API / geotoolkit / welllog / data / LogCurveDataSource / LogCurveDataSource
data.LogCurveDataSource.LogCurveDataSource
This class defines a well log curve data source.
Throws
if parameters depths and values are not specified properly
Example
import {LogCurveDataSource} from '@int/geotoolkit/welllog/data/LogCurveDataSource';
const data1 = new LogCurveDataSource({ 'depth': depthObject, 'values': valuesObject });↳
LogCurveDataSource
Constructors
Methods
Constructors
• new LogCurveDataSource(options?)
Constructor
| Name | Type | Description |
|---|---|---|
Optional options | Options | options |
LogAbstractData.constructor
Methods
▸ calculateNeatLimits(logScale, centerOnZeroOnNegativeMin, displayUnit): number[]
Return an array of neat min and max
| Name | Type | Description |
|---|---|---|
logScale | boolean | scale log scale |
centerOnZeroOnNegativeMin | boolean | If negative and positive values, center around 0 |
displayUnit | string | AbstractUnit | displayed unit |
number[]
LogAbstractData.calculateNeatLimits
▸ clear(): LogCurveDataSource
Clear log data.
▸ dispose(): void
Dispose.
void
▸ getClassName(): string
string
▸ getDataOrder(): Order
Return the order of the log data
▸ getDepth(index): number
Gets depth at index
| Name | Type | Description |
|---|---|---|
index | number | index |
number
▸ getDepthData(): NumericalDataSeries | NumericalDataSeriesView
Returns the internal series object used to store the depth data
NumericalDataSeries | NumericalDataSeriesView
the internal backing object
▸ getDepths(): number[]
Return an array of depths
number[]
▸ getIndexAt(depth, fromIndex?, toIndex?): number
Return index for specified depth
| Name | Type | Description |
|---|---|---|
depth | number | The depth for which you want to compute the index |
Optional fromIndex | number | index of sample in depths |
Optional toIndex | number | index of sample in depths |
number
▸ getIndexUnit(): AbstractUnit
Return the value unit
Throws
when this method is not implemented
▸ getMaxDepth(): number
Return maximum depth
Throws
when this method is not implemented
number
▸ getMaxMeaningDepth(): number
Return maximum Meaning depth (last depth with value)
number
LogAbstractData.getMaxMeaningDepth
▸ getMaxValue(): number
Return maximum data value
number
▸ getMinDepth(): number
Return minimum depth
Throws
when this method is not implemented
number
▸ getMinMeaningDepth(): number
Return minimum Meaning depth (first depth with value)
number
LogAbstractData.getMinMeaningDepth
▸ getMinValue(): number
Return minimum data value
number
▸ getName(): string
Return name of the data
string
▸ getSize(): number
Return the count of the samples
number
▸ getState(): LogDataState
Return state
▸ getTimeStamp(): number
Return the value to indicate if data source was changed
number
▸ getValue(index): number
Return value by index
| Name | Type | Description |
|---|---|---|
index | number | index of the sample in the array |
number
▸ getValueAt(depth, fromIndex?, toIndex?, interpolation?): number
Return the value matching the given depth or NaN if the given depth is out of the logdata depth range.
If the depths are strictly increasing:
- The returned value will be interpolated when necessary. See example 1
If the depths are not strictly increasing but never decreasing:
- The value returned will be the first one found (in the insertion order). See example 2
- The value returned will be interpolated between the last one found and its closest larger neighbor. See example 2
If the depths are not always increasing (not forward only):
- The value returned will be the last one found (in the insertion order). See example 3
- The value returned will be interpolated between the first one found and its closest larger neighbor. See example 3
Examples assume the default linear interpolation
Example
// Depth Value
// 0 0
// 100 1
// 200 2
getValueAt(100) // -> 1
getValueAt(150) // -> 1.5Example
// Depth Value
// 0 0
// 100 1
// 100 2
// 200 3
getValueAt(100) // -> 1
getValueAt(150) // -> 2.5Example
// Depth Value
// 0 0
// 100 1
// 200 2
// 100 3
getValueAt(100) // -> 3
getValueAt(150) // -> 1.5| Name | Type | Description |
|---|---|---|
depth | number | The depth for which you want to compute the value |
Optional fromIndex | number | index of sample in depths |
Optional toIndex | number | index of sample in depths |
Optional interpolation | InterpolationType | interpolation type for the value |
number
▸ getValueInRange(depth, prev, next): number
Return value by depth, using linear interpolation if necessary. See LogAbstractData.findValueAt.
Throws
when this method is not implemented
| Name | Type | Description |
|---|---|---|
depth | number | The depth for which you want to compute the value |
prev | number | The index of the largest previous depth |
next | number | The index of the smallest following depth |
number
LogAbstractData.getValueInRange
▸ getValueUnit(): AbstractUnit
Return value unit
▸ getValues(): number[]
Return an array of values
number[]
▸ getValuesData(): NumericalDataSeries | NumericalDataSeriesView
Returns the internal series object used to store the value data
NumericalDataSeries | NumericalDataSeriesView
the internal backing object
▸ 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
LogAbstractData.hasEventListener
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isForwardOnly(): boolean
Return true if data is in ascending order
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): LogCurveDataSource
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | LogAbstractData | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): LogCurveDataSource
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: LogCurveDataSource, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): LogCurveDataSource
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: LogCurveDataSource, args: EventMap[E]) => void | to be called |
this
▸ requestData(range, scale, callback?): void
| Name | Type | Description |
|---|---|---|
range | Range | range |
scale | number | scale |
Optional callback | () => void | callback to be called after loading data |
void
▸ resumeUpdate(forceUpdate): LogCurveDataSource
Resume update. forceUpdate updates data statistics (update min, max of values, depths...)
| Name | Type | Description |
|---|---|---|
forceUpdate | boolean | force update based on the state of the data |
this
▸ setData(options?): LogCurveDataSource
Sets data
Throws
if parameters depths and values are not specified properly
| Name | Type | Description |
|---|---|---|
Optional options | DataOptions | addition options |
this
▸ setIndexUnit(unit): LogCurveDataSource
Sets index unit
Throws
when this method is not implemented
| Name | Type | Description |
|---|---|---|
unit | string | AbstractUnit | index unit |
▸ setName(name): LogCurveDataSource
Set name of the data
| Name | Type | Description |
|---|---|---|
name | string | The log data name |
this
▸ setSilent(bool): LogCurveDataSource
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setState(state): LogCurveDataSource
Sets state of data. Values can be (Empty,Normal, Warning,Error,Fetching).
| Name | Type | Description |
|---|---|---|
state | LogDataState | state of data. |
this
▸ setValue(index, value): LogCurveDataSource
Set value by index
Throws
when this method is not implemented
| Name | Type | Description |
|---|---|---|
index | number | index of the sample |
value | number | sample values |
this
▸ setValueUnit(unit): LogCurveDataSource
Sets value unit
Throws
when this method is not implemented
| Name | Type | Description |
|---|---|---|
unit | string | AbstractUnit | value unit |
▸ suspendUpdate(): LogCurveDataSource
Suspend update
this
▸ Protected update(args?): void
Notify when data has been changed.
| Name | Type | Description |
|---|---|---|
Optional args | LogDataEvent | optional parameters |
void
▸ Protected updateDataStatistics(): LogCurveDataSource
Update data statistics
Throws
when this method is not implemented
LogAbstractData.updateDataStatistics
▸ updateTimeStamp(): void
Update time stamp
void
LogAbstractData.updateTimeStamp
▸ Static findValueAt(depth, depths, values, prev, next, interpolation?): number
Utility function to interpolate a value between two depths.
| Name | Type | Description |
|---|---|---|
depth | number | The depth for which you want to compute the value |
depths | number[] | The array of ordered depths |
values | number[] | The array of values |
prev | number | The index of the largest previous depth |
next | number | The index of the smallest following depth |
Optional interpolation | InterpolationType | interpolation type for the value |
number
The interpolated value or Number.NaN if outside the range
▸ Static getClassName(): string
string
▸ Static interpolateValueAt(depth, depthPrev, valuePrev, depthNext, valueNext, interpolation?): number
Utility function to interpolate a value between two depths.
| Name | Type | Description |
|---|---|---|
depth | number | The depth for which you want to compute the value |
depthPrev | number | prev depth |
valuePrev | number | prev value |
depthNext | number | next depth |
valueNext | number | next value |
Optional interpolation | InterpolationType | interpolation type for the value |
number
The interpolated value or Number.NaN if outside the range